1>>> from sklearn import preprocessing
2>>>
3>>> data = [100, 10, 2, 32, 31, 949]
4>>>
5>>> preprocessing.normalize([data])
6array([[0.10467389, 0.01046739, 0.00209348, 0.03349564, 0.03244891,0.99335519]])
7
1import pandas as pd
2from sklearn import preprocessing
3
4x = df.values #returns a numpy array
5min_max_scaler = preprocessing.MinMaxScaler()
6x_scaled = min_max_scaler.fit_transform(x)
7df = pd.DataFrame(x_scaled)
1from sklearn import preprocessing
2normalizer = preprocessing.Normalizer().fit(X_train)
3X_train = normalizer.transform(X_train)
4X_test = normalizer.transform(X_test)