0

I have this dataFrame

          1
269    0.00
270  141.28
271    2.25
279    0.00
346    1.00

I would like this one to be like the following

  269       270     271   279   346
 0.00    141.28    2.25  0.00  1.00

I use the function

df_reshape = pd.wide_to_long(df)

but it does not seem to be this

  • you mean transpose? https://stackoverflow.com/questions/42381639/how-do-i-transpose-dataframe-in-pandas-without-index – Jessica Apr 01 '19 at 22:46

2 Answers2

0

You want the transpose, df.T.

gmds
  • 19,325
  • 4
  • 32
  • 58
0

Use Transpose:

df.T
   269     270   271  279  346
1  0.0  141.28  2.25  0.0  1.0
Nathaniel
  • 3,230
  • 11
  • 18