熊猫:
data = data.dropna(axis = 'columns')我正在尝试使用cudf dataframe执行类似的操作,但apis不提供此功能。
我的解决方案是转换为pandas df,执行上述命令,然后重新转换为cudf。有没有更好的解决方案?
发布于 2020-03-30 22:31:09
cuDF现在支持基于列的dropna,因此可以执行以下操作:
import cudf
df = cudf.DataFrame({'a':[0,1,None], 'b':[None,0,2], 'c':[1,2,3]})
print(df)
a b c
0 0 null 1
1 1 0 2
2 null 2 3df.dropna(axis='columns')
c
0 1
1 2
2 3发布于 2019-06-25 22:42:16
在实现dropna之前,您可以检查每一列的null_count并使用null_count>0删除它们。
https://stackoverflow.com/questions/56382236
复制相似问题