'Splitting an address to geocode/ length of values does not match length of index

I am trying to split a list of addresses so that I can geocode them. Csv they are located in is alcoholics_inPerson the column is "Address"and the address is formatted like '121 Dekalb Ave, Brooklyn, NY 11201, USA'
Im confused how to get the state (NY) and the zip code (11201) separated. The error I keep getting is that the length of values does not match the length of index. because I keep getting the error I don't know if my code is right to do what I need to. Do I need to create a dictionary first?
#split addresses
alcoholics_inPerson['street'] = alcoholics_inPerson['Address'].str.split(',')[0]
alcoholics_inPerson['city'] = alcoholics_inPerson['Address'].str.split(',')[1]
alcoholics_inPerson['state'] = alcoholics_inPerson['Address'].str.split(',')[2][0:2]
alcoholics_inPerson['zip'] = alcoholics_inPerson['Address'].str.split(',')[2][-6:-1]
Solution 1:[1]
Seems you're looking for the os.chdir(path) method bundled with Python.
You must set a new route (absolute or relative) as the path parameter and it will change your working path to that route.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | MatÃas Zanolli |
