Skip to content

Commit 1def54a

Browse files
committed
changed according to comments
1 parent 9d99e5b commit 1def54a

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
@@ -1457,13 +1457,12 @@ def factorize(self, sort=False, na_sentinel=-1):
14571457
14581458
.. note::
14591459
1460-
The %(klass)s *must* be monotonically sorted, else wrong
1461-
index locations may be returned. Pandas does *not* check
1462-
this for you.
1460+
The %(klass)s *must* be monotonically sorted, otherwise
1461+
wrong locations will likely be returned. Pandas does *not*
1462+
check this for you.
14631463
14641464
You can check sortedness by calling
1465-
``is_monotonic_increasing/is_monotonic_decreasing`` on the
1466-
Series or Index.
1465+
:meth:`%(klass)s.is_monotonic_increasing`.
14671466
14681467
Parameters
14691468
----------
@@ -1522,7 +1521,7 @@ def factorize(self, sort=False, na_sentinel=-1):
15221521
>>> x = pd.Categorical(['apple', 'bread', 'bread',
15231522
'cheese', 'milk'], ordered=True)
15241523
[apple, bread, bread, cheese, milk]
1525-
Categories (4, object): [apple < bread < cheese < milk]
1524+
Categories (4, object): [apple <> bread < cheese < milk]
15261525
15271526
>>> x.searchsorted('bread')
15281527
1

pandas/tests/arrays/categorical/test_analytics.py

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def test_mode(self, values, categories, exp_mode):
7474
exp = Categorical(exp_mode, categories=categories, ordered=True)
7575
tm.assert_categorical_equal(res, exp)
7676

77-
@pytest.mark.parametrize("ordered", [True, False])
7877
def test_searchsorted(self, ordered):
7978
# https://github.com/pandas-dev/pandas/issues/8420
8079
# https://github.com/pandas-dev/pandas/issues/14522

0 commit comments

Comments
 (0)