0

I have a dataframe in pandas were each column has a different value range. For example:

df:

A     B   C
1000  10  0.5
765   5   0.35
800   7   0.09

How would I normalize all values as they were in one column i.e.

A  
1000
765
800
10
5
7
0.5
0.35
0.09

and still keep the original dataframe structure?

Thanks!

user3430556
  • 251
  • 1
  • 2
  • 5
  • `df.melt(value_name='A').drop('variable',1)` ? – anky Feb 18 '20 at 16:09
  • Thanks. How do I return to the original dataframe column structure after I used melt? i.e. A,B,C columns. – user3430556 Feb 18 '20 at 16:16
  • dont use the drop then, `df.melt(value_name='A')` should do it? original column structure should not be kept as this is unpivotting ? – anky Feb 18 '20 at 16:17

0 Answers0