Skip to content

Commit

Permalink
DOC: Clarify loc and iloc functionality in user_guide/indexing.html (p…
Browse files Browse the repository at this point in the history
…andas-dev#60501)

* Fix iloc wording error on indexing user guide page

* Update doc/source/user_guide/indexing.rst

---------

Co-authored-by: Matthew Roeschke <[email protected]>
  • Loading branch information
2 people authored and gmcrocetti committed Jan 3, 2025
1 parent 22e63a3 commit b1e732e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doc/source/user_guide/indexing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -858,9 +858,10 @@ and :ref:`Advanced Indexing <advanced>` you may select along more than one axis
.. warning::

``iloc`` supports two kinds of boolean indexing. If the indexer is a boolean ``Series``,
an error will be raised. For instance, in the following example, ``df.iloc[s.values, 1]`` is ok.
The boolean indexer is an array. But ``df.iloc[s, 1]`` would raise ``ValueError``.
While ``loc`` supports two kinds of boolean indexing, ``iloc`` only supports indexing with a
boolean array. If the indexer is a boolean ``Series``, an error will be raised. For instance,
in the following example, ``df.iloc[s.values, 1]`` is ok. The boolean indexer is an array.
But ``df.iloc[s, 1]`` would raise ``ValueError``.

.. ipython:: python
Expand Down

0 comments on commit b1e732e

Please sign in to comment.