Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

sklearn minmaxscaler pandas

>>> import pandas as pd
>>> from sklearn.preprocessing import MinMaxScaler


>>> scaler = MinMaxScaler()

>>> dfTest = pd.DataFrame({'A':[14.00,90.20,90.95,96.27,91.21],
                           'B':[103.02,107.26,110.35,114.23,114.68],
                           'C':['big','small','big','small','small']})

>>> dfTest[['A', 'B']] = scaler.fit_transform(dfTest[['A', 'B']])

>>> dfTest
          A         B      C
0  0.000000  0.000000    big
1  0.926219  0.363636  small
2  0.935335  0.628645    big
3  1.000000  0.961407  small
4  0.938495  1.000000  small
Comment

PREVIOUS NEXT
Code Example
Python :: read database pandas 
Python :: pandas determine percentage of nans in column 
Python :: tkinter image 
Python :: how to save plot in python 
Python :: mongodb between two values 
Python :: char to binary python 
Python :: show jpg in jupyter notebook 
Python :: multiple variable input in python 
Python :: ImportError: cannot import name ‘json’ from itsdangerous 
Python :: blender python set object location 
Python :: py get days until date 
Python :: tkinter canvas remove border 
Python :: matrix pow python 
Python :: how to set a image as background in tkitner 
Python :: Cool codes for Python 
Python :: what happen when we apply * before list in python 
Python :: how to play sound after pressing a button in tkinter 
Python :: python server http one line 
Python :: how to make it so the pygame window will close 
Python :: openpyxl font 
Python :: conver all dict keys to str python 
Python :: pyplot define plotsize 
Python :: converting a csv into python list 
Python :: how to detect a keypress tkinter 
Python :: NotImplementedError: Please use HDF reader for matlab v7.3 files 
Python :: matplotlib matrix plot 
Python :: how to print char of element in list of pytohn 
Python :: pandas reciprocal 
Python :: pandas convert column to index 
Python :: tf.squeeze() 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =