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] cudf.to_numeric does not preserve the index #14717

Closed
rjzamora opened this issue Jan 8, 2024 · 0 comments · Fixed by #14718
Closed

[BUG] cudf.to_numeric does not preserve the index #14717

rjzamora opened this issue Jan 8, 2024 · 0 comments · Fixed by #14718
Labels
bug Something isn't working

Comments

@rjzamora
Copy link
Member

rjzamora commented Jan 8, 2024

Describe the bug
When pd.to_numeric(<series>) is called on a series with a non-default index, that index is preserved. When cudf.to_numeric is used on the same data, the original index is replaced with a default RangeIndex

Steps/Code to reproduce bug

import cudf, pandas as pd

ser = pd.Series(["1"] * 8, index=range(2, 10))
pd.to_numeric(ser).index  # RangeIndex(start=2, stop=10, step=1)

cudf.to_numeric(ser).index  # RangeIndex(start=0, stop=8, step=1)

gser = cudf.from_pandas(ser)
cudf.to_numeric(ser).index  # RangeIndex(start=0, stop=8, step=1)

Expected behavior
I would not expect cudf.to_numeric to modify the index of the original Series at all. Even if the original index is non-numeric, it should be preserved.

@rjzamora rjzamora added bug Something isn't working Needs Triage Need team to review and classify labels Jan 8, 2024
rapids-bot bot pushed a commit that referenced this issue Jan 9, 2024
@bdice bdice removed the Needs Triage Need team to review and classify label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants