You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This feels relatively expensive compared to the other dtypes we infer. We would need to track all the distinct types in data, extract the enum types, ensure that they're unique, and then extract the categories.
I'd prefer to make it easier to convert an Enum to a CategoricalDtype. Perhaps a CategoricalDtype.from_enum constructor.
@TomAugspurger. I agree. I still however don't think IntEnums should be inferred as standard integers, but maybe that should be a different thread for discussion.
Is your feature request related to a problem?
This relates to #36124, but I think has other benefits.
Describe the solution you'd like
I would like pandas to infer an array of Enums as categorical data. Today, IntEnums are turned into Ints, which is not ideal behavior.
API breaking implications
This is a change to the way part of the current API behaves, but I believe it provides a more intuitive processing of Enum data.
Describe alternatives you've considered
Additional context
# Your code here, if applicable
The text was updated successfully, but these errors were encountered: