如何检查dask数据框是否为空
问题描述:
是否有等效于pandas empty
函数的功能?我想检查dask数据框是否为空,但df.empty
返回AttributeError: 'DataFrame' object has no attribute 'empty'
Is there a dask equivalent of pandas empty
function? I want to check if a dask dataframe is empty but df.empty
return AttributeError: 'DataFrame' object has no attribute 'empty'
答
Dask当前不支持此功能,但是您可以即时计算长度:
Dask doesn't currently support this, but you can compute the length on the fly:
len(df) == 0
len(df.index) == 0 # Likely to be faster