I have a multi level columns:
Item | CBP | SAC | ||
---|---|---|---|---|
Qty | Date | Qty | Date | |
Item A | 20 | 2/10/2021 | 32 | 3/12/2022 |
How do use pandas to change the above table to:
Item | Branch | Qty | Date |
---|---|---|---|
Item A | CBP | 20 | 2/10/2021 |
Item A | SAC | 30 | 3/12/2022 |
I usually use the melt in pandas (Convert columns into rows with Pandas)
I dont know how to process this since there is two level. Need help Thank you very much.