【发布时间】:2021-12-30 05:57:50
【问题描述】:
我正在使用dask 读取一个大的 csv 文件。我想根据一列值删除几行。如果该特定列的行值为空,我想删除整行。
我尝试使用.dropna:
df = df.dropna(subset=['tier1_name'],how = 'any',axis =0)
但是,我收到了这个错误:
TypeError: dropna() got an unexpected keyword argument 'axis'
所以我改用.drop:
df.drop(df['tier1_name'].isnull(), axis = 0)
但随后出现此错误:
"Drop currently only works for axis=1 or when columns is not None"
NotImplementedError: Drop currently only works for axis=1 or when columns is not None
我不明白应该使用什么来执行所需的操作。救命!
【问题讨论】:
标签: python null rows dask drop