错误显示“NotImplementedError:dd.DataFrame.apply仅支持axis=1尝试:df.apply(func,axis=1)”
下面是我的一行代码:
# Read the CSV file in using dask
import dask.dataframe as dd
df = dd.read_csv('CICIDSs.csv')
features = df.dtypes[df.dtypes !='object'].index
df[features] = df[features].apply(
lambda x: (x-x.mean())/ (x.std()))
#fill empty values by 0
df_pre = df.fillna(0)
print('===== Data Preprocessing =====')
print(df_pre)
我尝试使用建议的代码,但它输出一个错误,它说,func is not defined
1条答案
按热度按时间qni6mghb1#
而不是
您是否尝试: