I know there have been many questions on this topic, but still:
My input: as dataframe
task m_label
0 S101-10061 [Cecum Landmark, ICV, Comment, Appendiceal ori...
1 S101-10069 [Rectum RF, ICV, Cecum Landmark, TI, Comment, ...
2 S101-10078 [Appendiceal orifice, ICV, Cecum Landmark, Com...
3 S101-10088 [Cecum Landmark, ICV, Comment, Appendiceal ori...
4 S101-10100 [Transverse, Appendiceal orifice, ICV, Cecum L...
5 S101-10102 [Rectum RF, ICV, Cecum Landmark, Comment, TI, ...
6 S101-10133 [Rectum RF, Transverse, ICV, Cecum Landmark, C...
7 S101YGBgZ2 [Comment]
I wan to split like df.m_label.str.split("",expand=True) but it return NaN
Maybe problem with df? I get its from panda Series from: m_lab_task=data.groupby(['task'])['m_label'].unique(). So maybe in previously step it possible correct?
Required output:
task m_label1 m_label2 m_label3 m_label4 m_label5 m_label6
0 S101-10061 Cecum Landmark ICV Comment Appendiceal orifice
1 S101-10069 Rectum RF ICV Cecum Landmark TI Comment Transverse
2 S101-10078 Appendiceal orifice ICV Cecum Landmark Comment Transverse
Rectum RF
"and some not? Ism_lbela string column or does it have python lists?''to be in a separate column?