0

I have a data-frame that has multiple values in a cell that are delimited by a pipe and I need to map them to another cell with multiple pipe delimited values and then give them their own row along with data in the original row that doesn't have multiple values. My data-frame (df1) looks like this:

index  name                  city                          amount
1      frank | john | dave   toronto | new york | anaheim  10
2      george | joe | fred   fresno | kansas city | reno   20

I need it to look like this:

index  name    city          amount
1      frank   toronto       10
2      john    new york      10
3      dave    anaheim       10
4      george  fresno        20
5      joe     kansas city   20
6      fred    reno          20
KGBeans
  • 109
  • 1
  • 6
  • 1
    Possible duplicate of [How to explode a list inside a Dataframe cell into separate rows](http://stackoverflow.com/questions/32468402/how-to-explode-a-list-inside-a-dataframe-cell-into-separate-rows) – o-90 Aug 11 '16 at 21:14
  • 2
    Possible duplicate of [Split pandas dataframe string entry to separate rows](http://stackoverflow.com/questions/12680754/split-pandas-dataframe-string-entry-to-separate-rows) – Ami Tavory Aug 11 '16 at 21:20

0 Answers0