From 885010ede58ff20124612a2b8f7220f5fe0eeeda Mon Sep 17 00:00:00 2001 From: Chris Warth Date: Tue, 2 Dec 2014 10:47:10 -0800 Subject: [PATCH 1/2] add boolean array as option for indexing with .iloc --- doc/source/indexing.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/source/indexing.rst b/doc/source/indexing.rst index 920be3672acd4..ff53993ac330c 100644 --- a/doc/source/indexing.rst +++ b/doc/source/indexing.rst @@ -84,14 +84,17 @@ of multi-axis indexing. See more at :ref:`Selection by Label ` -- ``.iloc`` is strictly integer position based (from ``0`` to ``length-1`` of - the axis), will raise ``IndexError`` if an indexer is requested and it - is out-of-bounds, except *slice* indexers which allow out-of-bounds indexing. - (this conforms with python/numpy *slice* semantics). Allowed inputs are: +- ``.iloc`` is primarily integer position based (from ``0`` to + ``length-1`` of the axis), but may also be used with a boolean + array. ``.iloc`` will raise ``IndexError`` if a requested + indexer is out-of-bounds, except *slice* indexers which allow + out-of-bounds indexing. (this conforms with python/numpy *slice* + semantics). Allowed inputs are: - An integer e.g. ``5`` - A list or array of integers ``[4, 3, 0]`` - A slice object with ints ``1:7`` + - A boolean array See more at :ref:`Selection by Position ` From 951bae24f2e3c4f29c05f1c2a5c3984d370c57aa Mon Sep 17 00:00:00 2001 From: Chris Warth Date: Tue, 2 Dec 2014 10:47:10 -0800 Subject: [PATCH 2/2] add boolean array as option for indexing with .iloc --- doc/source/indexing.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/source/indexing.rst b/doc/source/indexing.rst index 920be3672acd4..f56e0d22b25a7 100644 --- a/doc/source/indexing.rst +++ b/doc/source/indexing.rst @@ -84,14 +84,17 @@ of multi-axis indexing. See more at :ref:`Selection by Label ` -- ``.iloc`` is strictly integer position based (from ``0`` to ``length-1`` of - the axis), will raise ``IndexError`` if an indexer is requested and it - is out-of-bounds, except *slice* indexers which allow out-of-bounds indexing. - (this conforms with python/numpy *slice* semantics). Allowed inputs are: +- ``.iloc`` is primarily integer position based (from ``0`` to + ``length-1`` of the axis), but may also be used with a boolean + array. ``.iloc`` will raise ``IndexError`` if a requested + indexer is out-of-bounds, except *slice* indexers which allow + out-of-bounds indexing. (this conforms with python/numpy *slice* + semantics). Allowed inputs are: - An integer e.g. ``5`` - A list or array of integers ``[4, 3, 0]`` - A slice object with ints ``1:7`` + - A boolean array See more at :ref:`Selection by Position ` @@ -368,6 +371,7 @@ The ``.iloc`` attribute is the primary access method. The following are valid in - An integer e.g. ``5`` - A list or array of integers ``[4, 3, 0]`` - A slice object with ints ``1:7`` +- A boolean array .. ipython:: python