CodeCollection2018
11/9/2018 - 7:14 AM

preprocessing.StandardScaler

sklearn方法

#标准化方法
import sklearn.preprocessing as preprocessing
scaler = preprocessing.StandardScaler()
age_scale_param = scaler.fit(df['Age'])
df['Age_scaled'] = scaler.fit_transform(df['Age'], age_scale_param)
------------------------------------------------------------------