Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if dask dataframe is 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'

like image 252
user308827 Avatar asked May 07 '18 03:05

user308827


1 Answers

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 
like image 131
cs95 Avatar answered Oct 21 '22 08:10

cs95