Skip to content

Commit 7672f4c

Browse files
committed
changed according to comments
1 parent f5c14ca commit 7672f4c

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

doc/source/whatsnew/v0.24.0.txt

-2
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,6 @@ Categorical
557557
^^^^^^^^^^^
558558

559559
- Bug in :meth:`Categorical.from_codes` where ``NaN`` values in `codes` were silently converted to ``0`` (:issue:`21767`). In the future this will raise a ``ValueError``. Also changes the behavior of `.from_codes([1.1, 2.0])`.
560-
- :meth:`Categorical.searchsorted` and :meth:`CategoricalIndex.searchsorted`
561-
now work on unordered categoricals also (:issue:`21667`)
562560
-
563561

564562
Datetimelike

pandas/core/base.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -1517,13 +1517,12 @@ def factorize(self, sort=False, na_sentinel=-1):
15171517
15181518
.. note::
15191519
1520-
The %(klass)s *must* be monotonically sorted, else wrong
1521-
index locations may be returned. Pandas does *not* check
1522-
this for you.
1520+
The %(klass)s *must* be monotonically sorted, otherwise
1521+
wrong locations will likely be returned. Pandas does *not*
1522+
check this for you.
15231523
15241524
You can check sortedness by calling
1525-
``is_monotonic_increasing/is_monotonic_decreasing`` on the
1526-
Series or Index.
1525+
:meth:`%(klass)s.is_monotonic_increasing`.
15271526
15281527
Parameters
15291528
----------
@@ -1582,7 +1581,7 @@ def factorize(self, sort=False, na_sentinel=-1):
15821581
>>> x = pd.Categorical(['apple', 'bread', 'bread',
15831582
'cheese', 'milk'], ordered=True)
15841583
[apple, bread, bread, cheese, milk]
1585-
Categories (4, object): [apple < bread < cheese < milk]
1584+
Categories (4, object): [apple <> bread < cheese < milk]
15861585
15871586
>>> x.searchsorted('bread')
15881587
1

pandas/tests/arrays/categorical/test_analytics.py

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ def test_mode(self, values, categories, exp_mode):
7878
exp = Categorical(exp_mode, categories=categories, ordered=True)
7979
tm.assert_categorical_equal(res, exp)
8080

81-
@pytest.mark.parametrize("ordered", [True, False])
8281
def test_searchsorted(self, ordered):
8382
# https://github.com/pandas-dev/pandas/issues/8420
8483
# https://github.com/pandas-dev/pandas/issues/14522

0 commit comments

Comments
 (0)