Skip to content

Commit 3645873

Browse files
committed
docs: update copy
1 parent 6a2820a commit 3645873

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spec/draft/API_specification/indexing.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Multi-dimensional arrays must extend the concept of single-axis indexing to mult
182182
Integer Array Indexing
183183
----------------------
184184

185-
An array must support indexing a one-dimensional array by a one-dimensional integer array according to the following rules. Let ``A`` be a one-dimensional array with shape ``S1 = (n,)``, and let ``J`` be a one-dimensional integer array with shape ``S2 = (k,)``.
185+
An array must support indexing a one-dimensional array by an integer array according to the following rules. Let ``A`` be a one-dimensional array with shape ``(n,)``, and let ``J`` be an integer array.
186186

187187
- Each integer index element in ``J`` must satisfy the rules stated above for indexing a single-axis (see :ref:`indexing-single-axis`). Namely,
188188

@@ -197,7 +197,9 @@ An array must support indexing a one-dimensional array by a one-dimensional inte
197197

198198
- Providing duplicate integer index elements in ``J`` must result in the duplication of the corresponding elements of ``A`` in the resulting array.
199199

200-
- The result of providing a valid integer index for each element in ``J`` must be an array having shape ``(k,)``.
200+
- If ``J`` is a zero-dimensional array containing an integer index ``k``, the result must be equivalent to providing a single-axis integer index ``k`` (i.e., if ``J`` is a zero-dimensional array, ``A[J]`` must equal ``A[k]``; see :ref:`indexing-single-axis).
201+
202+
- If ``J`` is a one-dimensional array with shape ``(k,)``, the result must be a one-dimensional array ``B``having shape ``(k,)``. Each element of ``B`` must follow the relation ``B[i] = A[J[i]]``.
201203

202204
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.
203205

0 commit comments

Comments
 (0)