How to check if dask dataframe is empty

笑着哭i 提交于 2020-05-29 02:46:33

问题


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'


回答1:


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 


来源:https://stackoverflow.com/questions/50206730/how-to-check-if-dask-dataframe-is-empty

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!