Skip to content

Commit dc71621

Browse files
committed
fixes
1 parent 19e3d29 commit dc71621

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

doc/source/whatsnew/v1.2.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ Categorical
523523
- :meth:`Categorical.fillna` will always return a copy, validate a passed fill value regardless of whether there are any NAs to fill, and disallow an ``NaT`` as a fill value for numeric categories (:issue:`36530`)
524524
- Bug in :meth:`Categorical.__setitem__` that incorrectly raised when trying to set a tuple value (:issue:`20439`)
525525
- Bug in :meth:`CategoricalIndex.equals` incorrectly casting non-category entries to ``np.nan`` (:issue:`37667`)
526-
- Bug in :meth:`Categorical.unique` where dtype was changed, it there were unused categories (:issue:`xxxxx`).
526+
- Bug in :meth:`Categorical.unique` where the dtype changes in the unique array if there are unused categories in the original array (:issue:`38140`).
527527
- Bug in :meth:`CategoricalIndex.where` incorrectly setting non-category entries to ``np.nan`` instead of raising ``TypeError`` (:issue:`37977`)
528528
-
529529

pandas/tests/arrays/categorical/test_analytics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def test_searchsorted(self, ordered):
189189
ser.searchsorted(["bread", "cucumber"])
190190

191191
def test_unique(self, ordered):
192-
# GHXXXXX
192+
# GH38140
193193
dtype = CategoricalDtype(["a", "b", "c"], ordered=ordered)
194194

195195
# categories are reordered based on value when ordered=False
@@ -213,7 +213,7 @@ def test_unique(self, ordered):
213213
tm.assert_categorical_equal(res, exp_cat)
214214

215215
def test_unique_index_series(self, ordered):
216-
# GHXXXXX
216+
# GH38140
217217
dtype = CategoricalDtype([3, 2, 1], ordered=ordered)
218218

219219
c = Categorical([3, 1, 2, 2, 1], dtype=dtype)

0 commit comments

Comments
 (0)