-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
BlockerBlocking issue or pull request for an upcoming releaseBlocking issue or pull request for an upcoming releaseCategoricalCategorical Data TypeCategorical Data TypeDependenciesRequired and optional dependenciesRequired and optional dependenciesgood first issue
Milestone
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
class CategoricalAccessor(PandasDelegate, PandasObject, NoNewAttributesMixin): |
We should do the same for .index
and .name
.
Metadata
Metadata
Assignees
Labels
BlockerBlocking issue or pull request for an upcoming releaseBlocking issue or pull request for an upcoming releaseCategoricalCategorical Data TypeCategorical Data TypeDependenciesRequired and optional dependenciesRequired and optional dependenciesgood first issue