0

I am trying to analyze chines GDP according to its provinces. I want to make a line chart that shows changing GDP over time but I cannot group them. i want to pivot the table but it is not working as I want. enter image description here

but I want to make it like this enter image description here

Abduhoshim
  • 11
  • 2

1 Answers1

1

It looks like you want to switch x and y axes. Use transpose. You can call it with T.

transposed_df = df_data.T
print(transposed_df)
Damiaan
  • 777
  • 4
  • 11