I have a dataframe that looks like this:
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!
CodePudding user response:
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