diff --git a/doc/source/whatsnew/v0.25.0.rst b/doc/source/whatsnew/v0.25.0.rst index aabe5bc3a57c7..293681b02988b 100644 --- a/doc/source/whatsnew/v0.25.0.rst +++ b/doc/source/whatsnew/v0.25.0.rst @@ -264,6 +264,7 @@ Deprecations - The :meth:`DataFrame.compound` and :meth:`Series.compound` methods are deprecated and will be removed in a future version. - The default value ``ordered=None`` in :class:`~pandas.api.types.CategoricalDtype` has been deprecated in favor of ``ordered=False``. When converting between categorical types ``ordered=True`` must be explicitly passed in order to be preserved. (:issue:`26336`) + .. _whatsnew_0250.prior_deprecations: Removal of prior version deprecations/changes diff --git a/pandas/core/dtypes/dtypes.py b/pandas/core/dtypes/dtypes.py index 35d89dc1628fd..160d2da18e4e4 100644 --- a/pandas/core/dtypes/dtypes.py +++ b/pandas/core/dtypes/dtypes.py @@ -543,8 +543,10 @@ def update_dtype(self, dtype): if new_ordered is None: new_ordered = self.ordered if self.ordered: - msg = ("ordered=None is deprecated and will default to False " - "in a future version; ordered=True must be explicitly " + msg = ("Constructing a CategoricalDtype without specifying " + "`ordered` or explicitly passing `ordered=None` is " + "deprecated and will default to `ordered=False` in a " + "future version; `ordered=True` must be explicitly " "passed in order to be retained") warnings.warn(msg, FutureWarning, stacklevel=3)