'Pivot/Unstack Pandas Dataframe Data
Grateful for your help. Sorry, could not figure this out as I wasn't sure if I'm pivoting or unstacking.
My data looks like this:
| Col1 | Col2 | Col3 | |
|---|---|---|---|
| si@si | A | 2 | D |
| ad@ad | A | 5 | C |
I'm looking to pivot this to:
| si@si | ad@ad | |
|---|---|---|
| Col1 | A | A |
| Col2 | 2 | 5 |
| Col3 | D | C |
Thanks so much!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
