Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] DataFrame.columns need to be RangeIndex instead of empty column in pandas compatibility mode #17747

Open
galipremsagar opened this issue Jan 15, 2025 · 2 comments
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@galipremsagar
Copy link
Contributor

Describe the bug
In pandas comaptibility mode, empty dataframe columns need to be a RangeIndex.

Steps/Code to reproduce bug

In [1]: import pandas as pd

In [2]: df = pd.DataFrame()

In [3]: df.columns
Out[3]: RangeIndex(start=0, stop=0, step=1)

In [4]: import cudf

In [5]: cudf.DataFrame().columns
Out[5]: Index([], dtype='object')

In [6]: cudf.set_option("mode.pandas_compatible", True)

In [7]: cudf.DataFrame().columns
Out[7]: Index([], dtype='object')
@galipremsagar galipremsagar added bug Something isn't working Python Affects Python cuDF API. labels Jan 15, 2025
@galipremsagar galipremsagar self-assigned this Jan 15, 2025
@mroeschke
Copy link
Contributor

IMO we should make cudf.DataFrame().columns return RangeIndex regardless of pandas compatible mode

@galipremsagar
Copy link
Contributor Author

IMO we should make cudf.DataFrame().columns return RangeIndex regardless of pandas compatible mode

Agreed 👍 Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Affects Python cuDF API.
Projects
Status: Todo
Development

No branches or pull requests

2 participants