Skip to content

Commit 4b662c9

Browse files
committed
changed according to comments
1 parent a564e2b commit 4b662c9

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
@@ -1459,13 +1459,12 @@ def factorize(self, sort=False, na_sentinel=-1):
14591459
14601460
.. note::
14611461
1462-
The %(klass)s *must* be monotonically sorted, else wrong
1463-
index locations may be returned. Pandas does *not* check
1464-
this for you.
1462+
The %(klass)s *must* be monotonically sorted, otherwise
1463+
wrong locations will likely be returned. Pandas does *not*
1464+
check this for you.
14651465
14661466
You can check sortedness by calling
1467-
``is_monotonic_increasing/is_monotonic_decreasing`` on the
1468-
Series or Index.
1467+
:meth:`%(klass)s.is_monotonic_increasing`.
14691468
14701469
Parameters
14711470
----------
@@ -1524,7 +1523,7 @@ def factorize(self, sort=False, na_sentinel=-1):
15241523
>>> x = pd.Categorical(['apple', 'bread', 'bread',
15251524
'cheese', 'milk'], ordered=True)
15261525
[apple, bread, bread, cheese, milk]
1527-
Categories (4, object): [apple < bread < cheese < milk]
1526+
Categories (4, object): [apple <> bread < cheese < milk]
15281527
15291528
>>> x.searchsorted('bread')
15301529
1

pandas/tests/arrays/categorical/test_analytics.py

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def test_mode(self, values, categories, exp_mode):
7171
exp = Categorical(exp_mode, categories=categories, ordered=True)
7272
tm.assert_categorical_equal(res, exp)
7373

74-
@pytest.mark.parametrize("ordered", [True, False])
7574
def test_searchsorted(self, ordered):
7675
# https://github.com/pandas-dev/pandas/issues/8420
7776
# https://github.com/pandas-dev/pandas/issues/14522

0 commit comments

Comments
 (0)