📜  在数据框中缩放特征的函数 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:19.787000             🧑  作者: Mango

代码示例1
# define a method to scale data, looping thru the columns, and passing a scaler
def scale_data(data, columns, scaler):
    for col in columns:
        data[col] = scaler.fit_transform(data[col].values.reshape(-1, 1))
    return data