import numpy as np
from sklearn import preprocessing
data = np.random.randint(0,10,size=(3,10))
print(data)
#array([[3, 1, 6, 0, 4, 2, 9, 5, 2, 8],
# [2, 8, 0, 6, 5, 0, 2, 9, 2, 6],
# [4, 7, 2, 5, 9, 5, 4, 4, 8, 6]])
data = np.ravel(data)[None,:].T
scaler = preprocessing.MinMaxScaler()
scaler.fit(data)
data = scaler.transform(data)
data = data.T.reshape(3,10)
print(data)
#array([[0.33333333, 0.11111111, 0.66666667, 0. , 0.44444444,
# 0.22222222, 1. , 0.55555556, 0.22222222, 0.88888889],
# [0.22222222, 0.88888889, 0. , 0.66666667, 0.55555556,
# 0. , 0.22222222, 1. , 0.22222222, 0.66666667],
# [0.44444444, 0.77777778, 0.22222222, 0.55555556, 1. ,
# 0.55555556, 0.44444444, 0.44444444, 0.88888889, 0.66666667]])