I think this is similar to this post but not exactly the same and I cannot get my head around it.
So, I currently have a (quite weird) pandas dataframe with lists in each cell like this:
>>> data = pd.DataFrame({'myid' : ['1', '2', '3'],
'num' : [['1', '2', '3'], ['1', '2'], []],
'text' : [['aa', 'bb', 'cc'], ['cc', 'dd'],
[]]}).set_index('myid')
>>> print(data)
num text
myid
1 [1, 2, 3] [aa, bb, cc]
2 [1, 2] [cc, dd]
3 [] []
I would like to achieve this:
myid num text
0 1 1 aa
0 1 2 bb
0 1 3 cc
1 2 1 cc
1 2 2 dd
2 3
How do I get there?