Series.__getitem__ materializes Categorical to ndarray #19318
Labels
Categorical
Categorical Data Type
Indexing
Related to indexing on series/frames, not to indexes themselves
Performance
Memory or execution speed performance
Milestone
For
we hit
pandas/pandas/core/indexes/base.py
Lines 2525 to 2543 in f0cd23c
_values_from_object
callsseries.get_values()
, which hitsCategorical.get_values
, which coerces to the ndarray of values.I have a branch based on my ExtensionArray stuff that "fixes" this by seeing if
s
is an instance ofExtensionArray
, which has the correct semantics for what we need here. But that's not necessarily the best fix here.master:
My branch:
The text was updated successfully, but these errors were encountered: