diff --git a/doc/source/whatsnew/v1.0.0.rst b/doc/source/whatsnew/v1.0.0.rst index 3c368eabadd1b..e54397e635c77 100644 --- a/doc/source/whatsnew/v1.0.0.rst +++ b/doc/source/whatsnew/v1.0.0.rst @@ -407,6 +407,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more. - Removed the previously deprecated "fastpath" keyword from the :class:`Index` constructor (:issue:`23110`) - Removed the previously deprecated :meth:`Series.get_value`, :meth:`Series.set_value`, :meth:`DataFrame.get_value`, :meth:`DataFrame.set_value` (:issue:`17739`) - Changed the the default value of `inplace` in :meth:`DataFrame.set_index` and :meth:`Series.set_axis`. It now defaults to False (:issue:`27600`) +- Removed the previously deprecated :attr:`Series.cat.categorical`, :attr:`Series.cat.index`, :attr:`Series.cat.name` (:issue:`24751`) - Removed support for nested renaming in :meth:`DataFrame.aggregate`, :meth:`Series.aggregate`, :meth:`DataFrameGroupBy.aggregate`, :meth:`SeriesGroupBy.aggregate`, :meth:`Rolling.aggregate` (:issue:`18529`) - Passing ``datetime64`` data to :class:`TimedeltaIndex` or ``timedelta64`` data to ``DatetimeIndex`` now raises ``TypeError`` (:issue:`23539`, :issue:`23937`) - A tuple passed to :meth:`DataFrame.groupby` is now exclusively treated as a single key (:issue:`18314`) diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 6cc3f660fb425..f20308be1ee09 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -2583,43 +2583,6 @@ def _delegate_method(self, name, *args, **kwargs): if res is not None: return Series(res, index=self._index, name=self._name) - @property - def categorical(self): - # Note: Upon deprecation, `test_tab_completion_with_categorical` will - # need to be updated. `categorical` will need to be removed from - # `ok_for_cat`. - warn( - "`Series.cat.categorical` has been deprecated. Use the " - "attributes on 'Series.cat' directly instead.", - FutureWarning, - stacklevel=2, - ) - return self._parent - - @property - def name(self): - # Note: Upon deprecation, `test_tab_completion_with_categorical` will - # need to be updated. `name` will need to be removed from - # `ok_for_cat`. - warn( - "`Series.cat.name` has been deprecated. Use `Series.name` instead.", - FutureWarning, - stacklevel=2, - ) - return self._name - - @property - def index(self): - # Note: Upon deprecation, `test_tab_completion_with_categorical` will - # need to be updated. `index` will need to be removed from - # ok_for_cat`. - warn( - "`Series.cat.index` has been deprecated. Use `Series.index` instead.", - FutureWarning, - stacklevel=2, - ) - return self._index - # utility routines diff --git a/pandas/tests/arrays/categorical/test_warnings.py b/pandas/tests/arrays/categorical/test_warnings.py index 53733770ed954..29bd5252dbe3a 100644 --- a/pandas/tests/arrays/categorical/test_warnings.py +++ b/pandas/tests/arrays/categorical/test_warnings.py @@ -1,6 +1,5 @@ import pytest -import pandas as pd import pandas.util.testing as tm @@ -15,15 +14,3 @@ def test_tab_complete_warning(self, ip): with tm.assert_produces_warning(None): with provisionalcompleter("ignore"): list(ip.Completer.completions("c.", 1)) - - def test_CategoricalAccessor_categorical_deprecation(self): - with tm.assert_produces_warning(FutureWarning): - pd.Series(["a", "b"], dtype="category").cat.categorical - - def test_CategoricalAccessor_name_deprecation(self): - with tm.assert_produces_warning(FutureWarning): - pd.Series(["a", "b"], dtype="category").cat.name - - def test_CategoricalAccessor_index_deprecation(self): - with tm.assert_produces_warning(FutureWarning): - pd.Series(["a", "b"], dtype="category").cat.index