I have a dataframe consists lists as cells. I run into the issues when I explode it. I understood that the list is stored inside the cell as str type not object type.
My code:
xdf = pd.DataFrame({'A':[str([1,2])],'B':[str([10,20])]})
xdf
A B
0 [1, 2] [10, 20]
xdf.apply(pd.Series.explode)
A B
0 [1, 2] [10, 20]
Desired output:
xdf =
A B
0 1 10
0 2 20