Suppose I have DataFrame
df
:
a b c
v f 3|4|5
v 2 6
v f 4|5
I'd like to produce this df
:
a b c
v f 3
v f 4
v f 5
v 2 6
v f 4
v f 5
I know how to make this transformation in R, using tidyr
package.
Is there an easy way of doing this in pandas?
You could:
to get:
Option 1
Option 2 Using
repeat
andloc
Details