0

I have the following structure of a dataframe in pandas

 A      |  B    |   C    | --- Z columns
------------------------------
12,35   | x,y   | google |
115     | z     | google |
1,88,35 | x,y,w | FB     |

I want to convert it into the following format

 A   | B |   C    | --- Z columns
------------------------------
12   | x | google |
35   | y | google |
115  | z | google |
1    | x | FB     |
88   | y | FB     |
35   | w | FB     |

What'd be the best way to go about it?

The split in my case is dependent on other column while the answers in other questions just simply split a column's values

Jaskaran Singh Puri
  • 729
  • 2
  • 11
  • 37
  • The `split` in my case is dependent on other column while the answers in other questions just simply split a column's values – Jaskaran Singh Puri Aug 21 '18 at 13:37
  • So is not possible define columns for split? – jezrael Aug 21 '18 at 13:42
  • The other solutions do not have a condition to do that. I want the split to happen in sequence by checking other columns. Those solution didn't work for me – Jaskaran Singh Puri Aug 21 '18 at 13:45
  • So is possible define columns fior splitting? Is also same values of lists after split like in sample in last value A and B is after split `3` values. Is possible `1,88,35 | x,y` - length of first value after split is 3 and second 2 ? – jezrael Aug 21 '18 at 13:56

0 Answers0