def standardize(x): return (x - x.min()) / (x.max()-x.min()) # 对指定列均一化 df[['col1', 'col2']] = df[['col1', 'col2']].apply(standardize, axis=0) print(df)
07-02
1015

01-20
11-18
def standardize(x): return (x - x.min()) / (x.max()-x.min()) # 对指定列均一化 df[['col1', 'col2']] = df[['col1', 'col2']].apply(standardize, axis=0) print(df)