-
Notifications
You must be signed in to change notification settings - Fork 996
Closed
Closed
Copy link
Labels
2 - In ProgressCurrently a work in progressCurrently a work in progressPythonAffects Python cuDF API.Affects Python cuDF API.bugSomething isn't workingSomething isn't working
Milestone
Description
Describe the bug
loc-based lookup does (I think incorrect) fallback to positional indexing rather than label-based lookup when the index is a categorical one with integer values.
Steps/Code to reproduce bug
import cudf
s = cudf.Series([1, 2], index=cudf.CategoricalIndex([3, 4], categories=[3, 4]))
s.loc[3] # IndexError: single positional indexer is out-of-boundsExpected behavior
s.to_pandas().loc[3]
# 1Annoyingly, one can't just stop doing positional indexing fallback in all cases because if the index is (say) a string index then integer indexing does fall back to positional. This is for Series.__getitem__ and the behaviour is deprecated in pandas 2.
Metadata
Metadata
Assignees
Labels
2 - In ProgressCurrently a work in progressCurrently a work in progressPythonAffects Python cuDF API.Affects Python cuDF API.bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done