I have a table like this
Program Seg Percent
N A 1%
N B 13%
N C 4%
Y A 6%
Y B 5%
Y C 8%
Would like to convert it to:
Seg A A B B C C
Program N Y N Y N Y
Percent 1% 6% 13% 5% 4% 8%
Whether seg or program appear as title of columns or row index is not really important. Just want it to be selectable in some way in python.
Note that simply transposing is not what I'm looking for. I need to have 'Seg' as the first variable, then 'Program'.
Looking for the solution in both Pandas and possibly Excel.
Thanks