about scaling

Some days ago, I wanted data that was scaled.
I found scikit-learn is best practice.
Like this….

import numpy as np
from sklearn import preprocessing

min_max_scaler = preprocessing.MinMaxScaler()
arr = np.array([[1, 10, 200],
                          [4, 30, 100],
                          [3, 20 ,300]], dtype="float")

arr_minmax = min_max_scaler.fit_transform( arr )
print arr

Then, I got….

rray([[ 0.        ,  0.        ,  0.5       ],
       [ 1.        ,  1.        ,  0.        ],
       [ 0.66666667,  0.5       ,  1.        ]])

It was easy !