1.数据的标准化与归一化处理
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import MinMaxScaler
import numpy as npdata = np.random.random_integers(0, 100, (100, 2))
ss = StandardScaler()
data = ss.fit_transform(data)
data1 = np.random.random_integers(0, 100, (100, 2))
mm = MinMaxScaler()
mm_data = mm.fit_transform(data1)
origin_data = mm.inverse_transform(mm_data)
#如果需要对其中的某一行进行reverse,则需要将数据reshape为(1,line)
2.numpy transpose的用法
>>> x = np.ones((1, 2, 3)) >>> np.transpose(x, (1, 0, 2)).shape (2, 1, 3)