You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/draft/API_specification/indexing.rst
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,7 +199,7 @@ An array must support indexing a one-dimensional array by a one-dimensional inte
199
199
200
200
- The result of providing a valid integer index for each element in ``J`` must be an array having shape ``S3 = (k,)``.
201
201
202
-
An array must support indexing an array having more than one dimension by an indexing tuple which includes only integers and one-dimensional integer arrays according to the following rules. Let ``A`` be an ``N``-dimensional array with shape ``S1 = (s1, ..., sM, ..., sN)`` and ``T`` be a tuple ``(t1, ..., tM, ..., tN)`` having length ``N`` and containing only valid integer and one-dimensional integer array indices.
202
+
An array must support indexing an array having more than one dimension by an indexing tuple which includes only integers and one-dimensional integer arrays according to the following rules. Let ``A`` be an ``N``-dimensional array with shape ``S1 = (s1, s2, ..., sN)`` and ``T`` be a tuple ``(t1, t2, ..., tN)`` having length ``N`` and containing only valid integer and one-dimensional integer array indices.
203
203
204
204
.. note::
205
205
This specification does not require bounds checking. The behavior for out-of-bounds integer indices is left unspecified.
@@ -212,9 +212,9 @@ An array must support indexing an array having more than one dimension by an ind
212
212
213
213
- An ``IndexError`` exception must be raised if any element of ``T`` is not broadcast-compatible with ``J`` (see :ref:`broadcasting`).
214
214
215
-
- After broadcasting, ``T`` must be equivalent to a tuple ``U = (u1, ..., uM, ..., uN)`` containing only one-dimensional integer arrays having shape ``S2``.
215
+
- After broadcasting, ``T`` must be equivalent to a tuple ``U = (u1, u2, ..., uN)`` containing only one-dimensional integer arrays having shape ``S2``.
216
216
217
-
- Let ``v_i`` be the tuple formed by the integer indices ``u1[i], u2[i], ..., uM[i], ..., uN[i]``. When applying the indexing tuple ``U`` to ``A``, the resulting array must be a one-dimensional array containing each element ``A[v_i]`` for ``i`` on the half-open interval ``[0, m)``.
217
+
- Let ``v_i`` be the tuple formed by the integer indices ``u1[i], u2[i], ..., uN[i]``. When applying the indexing tuple ``U`` to ``A``, the resulting array must be a one-dimensional array having shape ``(m,)`` and containing each element ``A[v_i]`` for ``i`` on the half-open interval ``[0, m)``.
218
218
219
219
.. note::
220
220
This specification does not currently address indexing tuples which combine slices and integer arrays. Behavior for such indexing tuples is left unspecified and thus implementation-defined. This may be revisited in a future revision of this standard.
0 commit comments