Closed
Description
Previously, CategoricalAccessor set .categorical
in __init__
. I don't think this was intended to be the way to access things like .ordered
, but it wasn't prefixed with an underscore, so we should deprecate before removing
0.23.4
In [11]: pd.Series(['a', 'b'], dtype='category').cat.categorical.ordered
Out[11]: False
0.24.0rc1
In [3]: pd.Series(['a', 'b'], dtype='category').cat.categorical.ordered
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-e5c7f0300480> in <module>
----> 1 pd.Series(['a', 'b'], dtype='category').cat.categorical.ordered
AttributeError: 'CategoricalAccessor' object has no attribute 'categorical'
We can deprecate with
def categorical(self):
warnings.warn(...)
return self._parent
in
pandas/pandas/core/arrays/categorical.py
Line 2472 in 33f91d8
We should do the same for .index
and .name
.