Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Index(data=..., dtype=CategoricalDtype(...)) doesn't maintain dtype #19032
Code Sample, a copy-pastable example if possible
Notice that the index isn't ordered and the categories have changed location.
If construction goes through CategoricalIndex, everything is ok.
Expected output is
Could you maybe also do the same for
This should only be 2 lines more....
The block is actually already there, so it's really just a matter of passing
Planning to open an issue in the near future to allow subtype conversion for
FYI, my use case is combining several series of the same dtype, and there may be several such groups. If I can pre-register the dtype, I can covert to the result index simply by