BUG: IntervalIndex.astype("category") doesn't preserve exact interval dtype in categories #38316
Labels
Astype
Bug
Categorical
Categorical Data Type
Dtype Conversions
Unexpected or buggy dtype conversions
Interval
Interval data type
Milestone
Somewhere in the conversion, before factorizing, we convert the interval array/index to a object-dtype numpy array of Interval objects, and so afterwards infer the IntervalDtype again when creating the categories.
Example consequence is that if you have uint64 intervals, they get inferred as int64 afterwards:
The text was updated successfully, but these errors were encountered: