Im trying to turn this
iVWAPBucket Side NotionalTraded
0 -10 - -5 bps Buy 0.079994
1 -2.5 - 0 bps Buy 0.031706
2 0 - 2.5 bps Buy 0.138434
3 10 - 25 bps Buy 0.296976
4 2.5 - 5 bps Buy 0.078794
5 2.5 - 5 bps Sell 0.292118
6 5 - 10 bps Buy 0.081977
into this
iVWAPBucket Buy Sell
0 -10 - -5 bps 0.079994 -
1 -2.5 - 0 bps 0.031706 -
2 0 - 2.5 bps 0.138434 -
3 10 - 25 bps 0.296976 -
4 2.5 - 5 bps 0.078794 -
5 2.5 - 5 bps - 0.292118
6 5 - 10 bps 0.081977 -
What is the most efficient way of doing this? I can do a single column like this, but can with multiple
primary_breakdown_table.pivot(index=primary_breakdown_table.index, columns='Side')['NotionalTraded']