【发布时间】:2022-07-06 21:53:45
【问题描述】:
我想创建一个预处理函数,为数据框名称添加后缀。
这将使我能够轻松识别我的数据框,无论是否使用特征缩放以及使用的技术(如果适用)。
例如:
mas = MaxAbsScaler()
def preproce_MaxAbsScaler(df):
[df+str("_mas")]=pd.DataFrame(mas.fit_transform(df),
index=df.index,
columns=df.columns)
return [df+str("_mas")]
【问题讨论】:
-
我觉得这个话题可以帮到你:Create variable name from two string in python
标签: python pandas string dataframe function