Skip to content

Commit 7be0236

Browse files
Chris Warthjreback
Chris Warth
authored andcommitted
add boolean array as option for indexing with .iloc
1 parent 12d71f0 commit 7be0236

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

doc/source/indexing.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,17 @@ of multi-axis indexing.
8484

8585
See more at :ref:`Selection by Label <indexing.label>`
8686

87-
- ``.iloc`` is strictly integer position based (from ``0`` to ``length-1`` of
88-
the axis), will raise ``IndexError`` if an indexer is requested and it
89-
is out-of-bounds, except *slice* indexers which allow out-of-bounds indexing.
90-
(this conforms with python/numpy *slice* semantics). Allowed inputs are:
87+
- ``.iloc`` is primarily integer position based (from ``0`` to
88+
``length-1`` of the axis), but may also be used with a boolean
89+
array. ``.iloc`` will raise ``IndexError`` if a requested
90+
indexer is out-of-bounds, except *slice* indexers which allow
91+
out-of-bounds indexing. (this conforms with python/numpy *slice*
92+
semantics). Allowed inputs are:
9193

9294
- An integer e.g. ``5``
9395
- A list or array of integers ``[4, 3, 0]``
9496
- A slice object with ints ``1:7``
97+
- A boolean array
9598

9699
See more at :ref:`Selection by Position <indexing.integer>`
97100

@@ -368,6 +371,7 @@ The ``.iloc`` attribute is the primary access method. The following are valid in
368371
- An integer e.g. ``5``
369372
- A list or array of integers ``[4, 3, 0]``
370373
- A slice object with ints ``1:7``
374+
- A boolean array
371375

372376
.. ipython:: python
373377

0 commit comments

Comments
 (0)