normalise in python code example
Example 1: normalize data python
>>> from sklearn import preprocessing
>>>
>>> data = [100, 10, 2, 32, 31, 949]
>>>
>>> preprocessing.normalize([data])
array([[0.10467389, 0.01046739, 0.00209348, 0.03349564, 0.03244891,0.99335519]])
Example 2: standardise columns python
from sklearn.preprocessing import StandardScaler
df[['col1', 'col2']] = StandardScaler().fit_transform(df[['col1', 'col2']])