I have a csv that looks like this:
FIPS display_name Value
2013 "Aleutians East, (AK)" 172.9
2016 "Aleutians West, (AK)" 172.2
I want to split a column into 2 columns. I tried this:
df['county','state'] = df['display_name'].str.split(', ',expand=True)
The output was this:
cnty_fips display_name Value (county, state)
2013 "Aleutians East 172.9 "Aleutians East
2016 "Aleutians West 172.2 "Aleutians West
Not sure why the second half of the data is erased and not made into a new column. How can I get two new columns when I split a column where one gives the county and another the state?