I have an excel file with data as
StudentId Details
1234 John, Texas, United States
9887 Roma, Moscow, Russia
I want to convert it into the following format, such that:
StudentId Details
1234 John
Texas
United States
9887 Roma
Moscow
Russia
I am using Pandas for this purpose but not getting the results
for i in range(len(df['Details'])):
df['Details'][i]=df['Details'][i].replace(',','\n')
I am using somewhat this kind of logic
Read it in with read_fwf()
then split up that column later:
df['Details'].str.split(',')