I have following dataframe:
df=pd.DataFrame({'A': ['1','2', '3'], 'List': [['a1','a2'], ['b1','b2'], ['c1','c2']]})
Out[18]:
A List
0 1 [a1, a2]
1 2 [b1, b2]
2 3 [c1, c2]
I would like to explode the column List into two new columns (L1 and L2) at the same row.
A L1 L2
0 1 a1 a2
1 2 b1 b2
2 3 c1 c2
Which would be the fastest way to do it?
It would be great to assign also the names for the columns at the same time (L1 and L2).
Thank you in advance and best regards,
Pablo G

