Skip to content

DOC: fix categorical comparison example (GH8946) #9035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions doc/source/categorical.rst
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@ Comparisons
Comparing categorical data with other objects is possible in three cases:

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

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

.. ipython:: python

cat == cat_base2
cat == cat_base
cat == np.array([1,2,3])
cat == 2

This doesn't work because the categories are not the same:
Expand Down