Cudf: [BUG] DataFrame.empty doesn't perform as advertised in the documentation

Created on 19 Jun 2020  路  3Comments  路  Source: rapidsai/cudf

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
bug cuDF (Python)

Most helpful comment

This can be closed as it is fixed as part of : https://github.com/rapidsai/cudf/pull/5649/

All 3 comments

@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

Was this page helpful?
0 / 5 - 0 ratings