Closed
Description
Hi
I meet an unexpected behavior for categorical series
After reindex() a categorical series, astype() will raise Exception
For example, code below raise ValueError: Wrong number of dimensions
s = Series([1, 2, 3], index = [2, 0, 1])
(s.astype('category')
.reindex([0, 1, 2])
.astype(str))
However, if I reindex() first then set the series categorical, astype() works as expected.
Code below works fine
s = Series([1, 2, 3], index = [2, 0, 1])
(s.reindex([0, 1, 2])
.astype('category')
.astype(str))
I think both code should behave the same way