Answers for "pandas transpose"

3

transpose of dataframe

result = df.transpose()
  
Posted by: Guest on June-01-2021
1

pandas transpose

df.T
df.head().T
Posted by: Guest on September-29-2021
-1

dataframe index column invert

In [11]: df
Out[11]:
         10  20  30  70
data1:  2.3   5   6   7

In [12]: df.T
Out[12]:
    data1:
10     2.3
20     5.0
30     6.0
70     7.0
Posted by: Guest on April-17-2020
-1

pandas dataframe to change data to horizontally

| id | name | country01 | sort01 | country02 | sort02 | country03 | sort03 |
| 1 | Foo | USA | 1 | Japan | 2 | China | 3 |
| 2 | Bar | USA | 1| UK | 3 | France | 4 |
| 3 | Zap | Japan | 2 | UK | 3 | Russia | 5 |
Posted by: Guest on June-30-2020

Python Answers by Framework

Browse Popular Code Answers by Language