Skip to content

Commit 700c018

Browse files
DOC: fix categorical comparison example (GH8946)
1 parent 7d13fdd commit 700c018

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/source/categorical.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,9 @@ Comparisons
356356
Comparing categorical data with other objects is possible in three cases:
357357

358358
* comparing equality (``==`` and ``!=``) to a list-like object (list, Series, array,
359-
...) of the same length as the categorical data or
359+
...) of the same length as the categorical data.
360360
* all comparisons (``==``, ``!=``, ``>``, ``>=``, ``<``, and ``<=``) of categorical data to
361-
another categorical Series, when ``ordered==True`` and the `categories` are the same or
361+
another categorical Series, when ``ordered==True`` and the `categories` are the same.
362362
* all comparisons of a categorical data to a scalar.
363363

364364
All other comparisons, especially "non-equality" comparisons of two categoricals with different
@@ -392,7 +392,8 @@ Equality comparisons work with any list-like object of same length and scalars:
392392

393393
.. ipython:: python
394394
395-
cat == cat_base2
395+
cat == cat_base
396+
cat == np.array([1,2,3])
396397
cat == 2
397398
398399
This doesn't work because the categories are not the same:

0 commit comments

Comments
 (0)