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
<li><p><strong>x</strong> (<em>array</em>) – input array. Should have one or more dimensions (axes).</p></li>
480
-
<li><p><strong>indices</strong> (<em>array</em>) – array indices. The array must be one-dimensional and have an integer data type. If an index is negative, the function must determine the element to select along a specified axis (dimension) by counting from the last element (where <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code> refers to the last element).</p></li>
481
-
<li><p><strong>axis</strong> (<em>Optional</em><em>[</em><em>int</em><em>]</em>) – <p>axis over which to select values. If <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code> is negative, the function must determine the axis along which to select values by counting from the last dimension (where <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code> refers to the last dimension).</p>
482
-
<p>If <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> is a one-dimensional array, providing an <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code>is optional; however, if <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has more than one dimension, providing an <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code>is required.</p>
479
+
<li><p><strong>x</strong> (<em>array</em>) – input array. <strong>Should</strong> have one or more axes.</p></li>
480
+
<li><p><strong>indices</strong> (<em>array</em>) – array indices. The array <strong>must</strong> be one-dimensional and have an integer data type. If an index is negative, the function <strong>must</strong> determine the element to select along a specified axis by counting from the last element (where <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code> refers to the last element).</p></li>
481
+
<li><p><strong>axis</strong> (<em>Optional</em><em>[</em><em>int</em><em>]</em>) – <p>axis over which to select values. If <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code> is negative, the function <strong>must</strong> determine the axis along which to select values by counting from the last axis (where <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code> refers to the last axis).</p>
482
+
<p>If <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> is a one-dimensional array, providing an <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code><strong>must</strong> be optional; however, if <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has more than one axis, providing an <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code><strong>must</strong> be required.</p>
<ddclass="field-even"><p><strong>out</strong> (<em>array</em>) – an array having the same data type as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>. The output array must have the same rank (i.e., number of dimensions) as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> and must have the same shape as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>, except for the axis specified by <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code> whose size must equal the number of elements in <codeclass="docutils literal notranslate"><spanclass="pre">indices</span></code>.</p>
487
+
<ddclass="field-even"><p><strong>out</strong> (<em>array</em>) – an array having the same data type as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>. The output array <strong>must</strong> have the same number of axes as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> and <strong>must</strong> have the same shape as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>, except for the axis specified by <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code> whose size <strong>must</strong> equal the number of elements in <codeclass="docutils literal notranslate"><spanclass="pre">indices</span></code>.</p>
488
488
</dd>
489
489
</dl>
490
490
<pclass="rubric">Notes</p>
491
491
<ulclass="simple">
492
-
<li><p>Conceptually, <codeclass="docutils literal notranslate"><spanclass="pre">take(x,</span><spanclass="pre">indices,</span><spanclass="pre">axis=3)</span></code> is equivalent to <codeclass="docutils literal notranslate"><spanclass="pre">x[:,:,:,indices,...]</span></code>; however, explicit indexing via arrays of indices is not currently supported in this specification due to concerns regarding <codeclass="docutils literal notranslate"><spanclass="pre">__setitem__</span></code> and array mutation semantics.</p></li>
493
-
<li><p>This specification does not require bounds checking. The behavior for out-of-bounds indices is left unspecified.</p></li>
492
+
<li><p>This specification does not require bounds checking. The behavior for out-of-bounds indices is unspecified and thus implementation-defined.</p></li>
494
493
<li><p>When <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> is a zero-dimensional array, behavior is unspecified and thus implementation-defined.</p></li>
<li><p><strong>x</strong> (<em>array</em>) – input array. Must be compatible with <codeclass="docutils literal notranslate"><spanclass="pre">indices</span></code>, except for the axis (dimension) specified by <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code> (see <aclass="reference internal" href="../broadcasting.html#broadcasting"><spanclass="std std-ref">Broadcasting</span></a>).</p></li>
480
-
<li><p><strong>indices</strong> (<em>array</em>) – array indices. Must have the same rank (i.e., number of dimensions) as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>. If an index is negative, the function must determine the element to select along a specified axis (dimension) by counting from the last element (where <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code> refers to the last element).</p></li>
481
-
<li><p><strong>axis</strong> (<em>int</em>) – axis along which to select values. If <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code>is negative, the function must determine the axis along which to select values by counting from the last dimension (where <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code> refers to the last dimension). Default: <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code>.</p></li>
479
+
<li><p><strong>x</strong> (<em>array</em>) – input array. <strong>Must</strong> be compatible with <codeclass="docutils literal notranslate"><spanclass="pre">indices</span></code>, except for the axis specified by <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code> (see <aclass="reference internal" href="../broadcasting.html#broadcasting"><spanclass="std std-ref">Broadcasting</span></a>).</p></li>
480
+
<li><p><strong>indices</strong> (<em>array</em>) – array indices. <strong>Must</strong> have the same number of axes as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> and <strong>must</strong> be compatible with <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>, except for the axis specified by <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code> (see <aclass="reference internal" href="../broadcasting.html#broadcasting"><spanclass="std std-ref">Broadcasting</span></a>). If an index is negative, the function <strong>must</strong> determine the element to select along a specified axis by counting from the last element (where <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code> refers to the last element).</p></li>
481
+
<li><p><strong>axis</strong> (<em>int</em>) – axis along which to select values. A valid axis <strong>must</strong> be an integer on the interval <codeclass="docutils literal notranslate"><spanclass="pre">[-N,</span><spanclass="pre">N)</span></code>, where <codeclass="docutils literal notranslate"><spanclass="pre">N</span></code>is the number of axes in <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>. If an axis is specified as a negative integer, the function <strong>must</strong> determine the axis along which to perform the operation by counting backward from the last axis (where <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code> refers to the last axis). If provided an invalid axis, the function <strong>must</strong> raise an exception. Default: <codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code>.</p></li>
<ddclass="field-even"><p><strong>out</strong> (<em>array</em>) – an array having the same data type as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>. Must have the same rank (i.e., number of dimensions) as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> and must have a shape determined according to <aclass="reference internal" href="../broadcasting.html#broadcasting"><spanclass="std std-ref">Broadcasting</span></a>, except for the axis (dimension) specified by <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code> whose size must equal the size of the corresponding axis (dimension) in <codeclass="docutils literal notranslate"><spanclass="pre">indices</span></code>.</p>
485
+
<ddclass="field-even"><p><strong>out</strong> (<em>array</em>) – an array containing elements from <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>. The returned array <strong>must</strong> have the same data type as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>. The returned array <strong>must</strong>have the same number of axes as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> and <strong>must</strong> have a shape determined according to <aclass="reference internal" href="../broadcasting.html#broadcasting"><spanclass="std std-ref">Broadcasting</span></a>, except for the axis specified by <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code> whose size <strong>must</strong> equal the size of the corresponding axis in <codeclass="docutils literal notranslate"><spanclass="pre">indices</span></code>.</p>
486
486
</dd>
487
487
</dl>
488
488
<pclass="rubric">Notes</p>
489
489
<ulclass="simple">
490
-
<li><p>This specification does not require bounds checking. The behavior for out-of-bounds indices is left unspecified.</p></li>
490
+
<li><p>This specification does not require bounds checking. The behavior for out-of-bounds indices is unspecified and thus implementation-defined.</p></li>
491
491
</ul>
492
492
<divclass="versionadded">
493
493
<p><spanclass="versionmodified added">New in version 2024.12.</span></p>
0 commit comments