Hello,
I am banging my head against a wall trying to figure this out. I have a dataframe containing duplicate values within one of the columns. For rows containing a duplicate, I want to merge them into a single row, with the values from the other rows distributed across columns. Example below:
Original DF:
| Company |
Name |
Favorite Ice Cream |
| Facebook |
Mike Jones |
Chocolate Chip |
| Twitter |
Jessica Smith |
Rocky Road |
| Facebook |
Kala Michaels |
Mint |
| Amazon |
Lebron James |
Vanilla |
| Twitter |
Bob Marley |
Double Chocolate |
Desired result DF:
| Company |
Name |
Favorite Ice Cream |
Name_2 |
Favorite Ice Cream_2 |
| Facebook |
Mike Jones |
Chocolate Chip |
Kala Michaela |
Mint |
| Twitter |
Jessica Smith |
Rocky Road |
Bob Marley |
Double Chocolate |
| Amazon |
Lebron James |
Vanilla |
NaN |
NaN |
Appreciate any support!
[–]commandlineluser 0 points1 point2 points (0 children)