1

I need the below but with USD and EU under each of Bronze, Gold and Silver. How?

enter image description here

Edit - My question is different because I want the columns ABOVE the values.

P. S.R.
  • 129
  • 1
  • 12
  • See Question 6 in the dup: `df.pivot_table(index='Item', columns='CType', values=['USD', 'EU'], aggfunc='first')` – ALollz Jul 22 '19 at 20:28
  • Please see my edit. I am not wanting it to look like the screenshot but with the USD and EU under the Bronze, Gold and Silver – P. S.R. Jul 22 '19 at 21:06
  • Then assign the above to some variable (say `df1`) then do `df1 = df1.swaplevel(0,1, axis=1).sort_index(axis=1)`. I updated the duplicate list to include that. – ALollz Jul 22 '19 at 21:27
  • 1
    Perfect. Thank you! – P. S.R. Jul 22 '19 at 23:41

0 Answers0