Skip to content

Commit 38e3516

Browse files
committed
Use series in whatsnew example
1 parent 14d3fd2 commit 38e3516

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/source/whatsnew/v1.3.0.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,17 @@ These are bug fixes that might have notable behavior changes.
8383
``Categorical.unique`` now always maintains same dtype as original
8484
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8585

86-
Previously, when calling :meth:`Categorical.unique`, unused categories in the new array
86+
Previously, when calling :meth:`~Categorical.unique` with categorical data, unused categories in the new array
8787
would be removed, meaning that the dtype of the new array would be different than the
88-
original, if some categories are not present in the unique array:
88+
original, if some categories are not present in the unique array (:issue:`18291`)
8989

9090
As an example of this, given:
9191

9292
.. ipython:: python
9393
9494
dtype = pd.CategoricalDtype(['bad', 'neutral', 'good'], ordered=True)
95-
original = pd.Categorical(['good', 'good', 'bad', 'bad'], dtype=dtype)
95+
cat = pd.Categorical(['good', 'good', 'bad', 'bad'], dtype=dtype)
96+
original = pd.Series(cat)
9697
unique = original.unique()
9798
9899
*pandas < 1.2.0*:

0 commit comments

Comments
 (0)