Describe the bug
The documentation for the empty property of DataFrame states that the indicator returns True if any axes of the DataFrame is 0. This is not the case when a DataFrame contains N rows and 0 columns, the indicator returns False. I expect it to return True similar to pandas's empty function.
Steps/Code to reproduce bug
import cudf
df = cudf.DataFrame({'angles': [0, 3, 4], 'degrees': [360, 180, 360]})
empty_df = df.select_dtypes(include=object)
print("shape of empty_df: ", empty_df.shape)
print("is empty_df empty? ", empty_df.empty)
-----------------------------------------------------------------------
shape of empty_df: (3, 0)
is empty_df empty? False
Expected behavior
import pandas as pd
df = pd.DataFrame({'angles': [0, 3, 4], 'degrees': [360, 180, 360]})
empty_df = df.select_dtypes(include=object)
print("shape of empty_df: ", empty_df.shape)
print("is empty_df empty? ", empty_df.empty)
-----------------------------------------------------------------------
shape of empty_df: (3, 0)
is empty_df empty? True
@yasmina-altair thanks for the issue and great reproducible example!
@millerhooks can you tackle this?
This can be closed as it is fixed as part of : https://github.com/rapidsai/cudf/pull/5649/
Fixed by #5649
Most helpful comment
This can be closed as it is fixed as part of : https://github.com/rapidsai/cudf/pull/5649/