-1
A B C
Q 1 2
T 5 6

I would like to reshape the table so that the columns B & C become the index and have the Q & T be the columns?

1 Answers1

1

you can try pivot_table:

df = df.pivot_table(columns='A')

output:

A  Q  T
B  1  5
C  2  6
Nk03
  • 14,699
  • 2
  • 8
  • 22