I'm looking to use python to pivot values from one row into new columns, and then combine the rows. For example:
| Name | Random info | Role | Name |
|---|---|---|---|
| A | Yada | Owner | Bob |
| A | Yada | Approver | Jimmy |
| B | Nada | Owner | Sally |
| B | Nada | Approver | Susie |
Would become this:
| Name | Random Info | Owner | Approver |
|---|---|---|---|
| A | Yada | Bob | Jimmy |
| B | Nada | Sally | Susie |
What's the best way to do this?
I tried using the pivot functions available in pandas, but I kept getting different errors because I don't think my data is structured correctly compared to what the function is expecting.