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
  • 20,086
  • 2
  • 13
  • 28

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
  • 69
  • 7