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] Calling cat.as_ordered does not work on a sliced column #15778

Closed
rjzamora opened this issue May 17, 2024 · 0 comments · Fixed by #15780
Closed

[BUG] Calling cat.as_ordered does not work on a sliced column #15778

rjzamora opened this issue May 17, 2024 · 0 comments · Fixed by #15780
Labels
bug Something isn't working

Comments

@rjzamora
Copy link
Member

Describe the bug
A clear and concise description of what the bug is.

import cudf as lib  # Works for pandas, but not for cudf

df = lib.DataFrame({"a": list("caba"), "b": list(range(4))})
df["a"] = df["a"].astype("category")
df = df.iloc[:2]
df["a"].cat.as_ordered()
...
ValueError: Length of values (4) does not match length of index (2)

Related to #11795

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
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants
@rjzamora and others