From 2d39e7fc7b9269e27270e637a5aca9a816dd58b0 Mon Sep 17 00:00:00 2001 From: Takanori H Date: Fri, 31 Jul 2020 15:01:25 +0900 Subject: DOC: Remove the links for ``True`` and ``False`` (#16887) * DOC: use :py:data:True and :py:data:False --- doc/source/reference/arrays.indexing.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/source/reference/arrays.indexing.rst') diff --git a/doc/source/reference/arrays.indexing.rst b/doc/source/reference/arrays.indexing.rst index 56b99f272..3e600b7c4 100644 --- a/doc/source/reference/arrays.indexing.rst +++ b/doc/source/reference/arrays.indexing.rst @@ -377,15 +377,15 @@ type, such as may be returned from comparison operators. A single boolean index array is practically identical to ``x[obj.nonzero()]`` where, as described above, :meth:`obj.nonzero() ` returns a tuple (of length :attr:`obj.ndim `) of integer index -arrays showing the :const:`True` elements of *obj*. However, it is +arrays showing the :py:data:`True` elements of *obj*. However, it is faster when ``obj.shape == x.shape``. If ``obj.ndim == x.ndim``, ``x[obj]`` returns a 1-dimensional array -filled with the elements of *x* corresponding to the :const:`True` +filled with the elements of *x* corresponding to the :py:data:`True` values of *obj*. The search order will be :term:`row-major`, -C-style. If *obj* has :const:`True` values at entries that are outside +C-style. If *obj* has :py:data:`True` values at entries that are outside of the bounds of *x*, then an index error will be raised. If *obj* is -smaller than *x* it is identical to filling it with :const:`False`. +smaller than *x* it is identical to filling it with :py:data:`False`. .. admonition:: Example -- cgit v1.2.1 From 4cdd3606160de923fb4054cf93f4ea02a356def0 Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Mon, 14 Sep 2020 18:55:12 +0300 Subject: DOC: add new glossary terms (#17263) * DOC: add new glossary terms * DOC: link to python Ellipsis * DOC: fixes from review * DOC: fixes from review * DOC: remove glossary items that belong to python --- doc/source/reference/arrays.indexing.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/source/reference/arrays.indexing.rst') diff --git a/doc/source/reference/arrays.indexing.rst b/doc/source/reference/arrays.indexing.rst index 3e600b7c4..180a79dae 100644 --- a/doc/source/reference/arrays.indexing.rst +++ b/doc/source/reference/arrays.indexing.rst @@ -198,6 +198,7 @@ concepts to remember include: create an axis of length one. :const:`newaxis` is an alias for 'None', and 'None' can be used in place of this with the same result. +.. _advanced-indexing: Advanced Indexing ----------------- @@ -304,6 +305,8 @@ understood with an example. most important thing to remember about indexing with multiple advanced indexes. +.. _combining-advanced-and-basic-indexing: + Combining advanced and basic indexing """"""""""""""""""""""""""""""""""""" -- cgit v1.2.1 From 24d368a809827cd2cd787a470a65b4a7cd721d10 Mon Sep 17 00:00:00 2001 From: Takanori H Date: Sat, 3 Oct 2020 14:39:31 +0900 Subject: DOC: Fix the links for ``Ellipsis`` (#17431) --- doc/source/reference/arrays.indexing.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/source/reference/arrays.indexing.rst') diff --git a/doc/source/reference/arrays.indexing.rst b/doc/source/reference/arrays.indexing.rst index 180a79dae..b2a9f1d21 100644 --- a/doc/source/reference/arrays.indexing.rst +++ b/doc/source/reference/arrays.indexing.rst @@ -34,7 +34,7 @@ Basic Slicing and Indexing Basic slicing extends Python's basic concept of slicing to N dimensions. Basic slicing occurs when *obj* is a :class:`slice` object (constructed by ``start:stop:step`` notation inside of brackets), an -integer, or a tuple of slice objects and integers. :const:`Ellipsis` +integer, or a tuple of slice objects and integers. :py:data:`Ellipsis` and :const:`newaxis` objects can be interspersed with these as well. @@ -43,7 +43,7 @@ well. In order to remain backward compatible with a common usage in Numeric, basic slicing is also initiated if the selection object is any non-ndarray and non-tuple sequence (such as a :class:`list`) containing - :class:`slice` objects, the :const:`Ellipsis` object, or the :const:`newaxis` + :class:`slice` objects, the :py:data:`Ellipsis` object, or the :const:`newaxis` object, but not for integer arrays or other embedded sequences. .. index:: @@ -129,7 +129,7 @@ concepts to remember include: [5], [6]]]) -- :const:`Ellipsis` expands to the number of ``:`` objects needed for the +- :py:data:`Ellipsis` expands to the number of ``:`` objects needed for the selection tuple to index all dimensions. In most cases, this means that length of the expanded selection tuple is ``x.ndim``. There may only be a single ellipsis present. @@ -333,7 +333,7 @@ the subspace defined by the basic indexing (excluding integers) and the subspace from the advanced indexing part. Two cases of index combination need to be distinguished: -* The advanced indexes are separated by a slice, :const:`Ellipsis` or :const:`newaxis`. +* The advanced indexes are separated by a slice, :py:data:`Ellipsis` or :const:`newaxis`. For example ``x[arr1, :, arr2]``. * The advanced indexes are all next to each other. For example ``x[..., arr1, arr2, :]`` but *not* ``x[arr1, :, 1]`` -- cgit v1.2.1 From 44be9665f7730a80d04c4e114b6c99c54d297b46 Mon Sep 17 00:00:00 2001 From: Ben Derrett Date: Fri, 16 Oct 2020 13:09:47 +0100 Subject: DOC: Fix Boolean array indexing typo --- doc/source/reference/arrays.indexing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/source/reference/arrays.indexing.rst') diff --git a/doc/source/reference/arrays.indexing.rst b/doc/source/reference/arrays.indexing.rst index b2a9f1d21..9f82875ea 100644 --- a/doc/source/reference/arrays.indexing.rst +++ b/doc/source/reference/arrays.indexing.rst @@ -453,7 +453,7 @@ also supports boolean arrays and will work without any surprises. array([[ 3, 5], [ 9, 11]]) - Without the ``np.ix_`` call or only the diagonal elements would be + Without the ``np.ix_`` call, only the diagonal elements would be selected. Or without ``np.ix_`` (compare the integer array examples): -- cgit v1.2.1