I have a DataFrame like this (Pandas version 0.23.4)
Emp Factors Comments Action ActionText
1 "['1','1']" "["not","some"]" "['1']" "['good','as']"
2 "['1']" "['textB']" "[]" "['da']"
I cannot use
df.set_index('Emp').apply(lambda x: x.apply(pd.Series).stack()).reset_index().drop('level_1', 1)
as it is not unique always. PS: type of Factors, Comments, Action, ActionText are String in df. For any values of multiple entries ([,]) of the column, I want a new row in output DF. I want the output df be like
Emp Factors Comments Action ActionText
1 1 not 1 good
1 1 some 1 as
2 1 textB ""or nan da