0

I have a dataframe that looks like this: stats dataframe

What I would love to do, is to turn the PTS and REB value into respective columns with each value underneath, like

PTS   | REB
----------
14.29 | 5.71

Is this possible? I have intermediate experience with pandas, but through googling and the docs, it doesn't appear to be the easiest find.

Thanks!

not_speshal
  • 22,093
  • 2
  • 15
  • 30
edrinaldi88
  • 37
  • 1
  • 4

1 Answers1

0

You could use the transpose functionality.

df_transpose = df.T

or

df_transpose = df.transpose()

Here is the link to the doc:
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.transpose.html

DChaka
  • 71
  • 7