如何检查dask数据框是否为空 [英] How to check if dask dataframe is empty
本文介绍了如何检查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
这篇关于如何检查dask数据框是否为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文