Skip to content

Commit f85f7d9

Browse files
committed
changed according to comments
1 parent b8ed033 commit f85f7d9

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
@@ -1469,13 +1469,12 @@ def factorize(self, sort=False, na_sentinel=-1):
14691469
14701470
.. note::
14711471
1472-
The %(klass)s *must* be monotonically sorted, else wrong
1473-
index locations may be returned. Pandas does *not* check
1474-
this for you.
1472+
The %(klass)s *must* be monotonically sorted, otherwise
1473+
wrong locations will likely be returned. Pandas does *not*
1474+
check this for you.
14751475
14761476
You can check sortedness by calling
1477-
``is_monotonic_increasing/is_monotonic_decreasing`` on the
1478-
Series or Index.
1477+
:meth:`%(klass)s.is_monotonic_increasing`.
14791478
14801479
Parameters
14811480
----------
@@ -1534,7 +1533,7 @@ def factorize(self, sort=False, na_sentinel=-1):
15341533
>>> x = pd.Categorical(['apple', 'bread', 'bread',
15351534
'cheese', 'milk'], ordered=True)
15361535
[apple, bread, bread, cheese, milk]
1537-
Categories (4, object): [apple < bread < cheese < milk]
1536+
Categories (4, object): [apple <> bread < cheese < milk]
15381537
15391538
>>> x.searchsorted('bread')
15401539
1

pandas/tests/arrays/categorical/test_analytics.py

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

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

0 commit comments

Comments
 (0)