dataframe index column invert

Solutions on MaxInterview for dataframe index column invert by the best coders in the world

showing results for - "dataframe index column invert"
Lena
27 Aug 2017
1You're looking for the transpose (T) method
2
3In [11]: df
4Out[11]:
5         10  20  30  70
6data1:  2.3   5   6   7
7
8In [12]: df.T
9Out[12]:
10    data1:
1110     2.3
1220     5.0
1330     6.0
1470     7.0
Amelia
09 Aug 2016
1In [11]: df
2Out[11]:
3         10  20  30  70
4data1:  2.3   5   6   7
5
6In [12]: df.T
7Out[12]:
8    data1:
910     2.3
1020     5.0
1130     6.0
1270     7.0