i stuck with the problem how to devide pandas dataframe by row,
i have similar dataframe with column where values separated by \r\n and they are in one cell,
Color Shape Price
0 Green Rectangle\r\nTriangle\r\nOctangle 10
1 Blue Rectangle\r\nTriangle 15
and i need to devide this cell into several cells with the same values of other columns, like here
Color Shape Price
0 Green Rectangle 10
1 Green Triangle 10
2 Green Octangle 10
3 Blue Rectangle 15
4 Blue Tringle 15
how to do it better?
df.Shape.str.split(expand=True).stack(). Does that help? - John Zwinckexplode()after the split - anky