I am trying to split a column with comma delimited values into 2 columns but the str.split function returns columns with 0's and 1's instead of the split string values
I have a dataframe with a column 'Full Name' which has a full name with a comma separating last name from first name.
I used the str.split function which works when I execute it for display only. But: when I try to use the same function to add 2 new columns to the same dataframe with the split data, I get 2 new columns with the first populated with 0's and the second with 1's all the way.
The code that works to display the split data:
df2015_2019.iloc[:,0].str.split(',', expand=True)
Code that doesn't work to create new columns with split data:
df2015_2019['Lname'],df2015_2019['Fname'] = df2015_2019.iloc[:,0].str.split(',', expand=True)
I get a column 'Lname' with all 0's and a column 'Fname' with all 1's