I have a dataframe like this
Input
>>> df
sent cite
a 1,2,3
b 2,4
c 5
I want to transpose the dataframe that each row contains the values of cite and sent combined. Notice that the cite and the sent can be repeated (e.g, cite 2)
Expected Output
>>> df
cite sent
1 a
2 a
2 b
3 a
4 b
5 c
I have tried with this but it did not work
df = df.pivot( columns='cite', values='sent')