<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1501" rel="nofollow">http://projects.scipy.org/numpy/ticket/1501</a> on 2010-06-03 by trac user dgoldsmith, assigned to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pv/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pv">@pv</a>.</em></p>
<p dir="auto">Presently, the docstring standard does not specify how to note that an object is to be deprecated; it has been proposed that this needs to be rectified.</p>
<p dir="auto">Obviously, this should be an optional section in general, but required for objects once it is decided that they are to be deprecated.</p>
<p dir="auto">Discussion on scipy-dev agreed that this section should be at or near the top, but at the top or between the One-line and Extended Summaries have both been proposed - we will try to reach a consensus here.</p>
<p dir="auto">Proposed format is to utilize Sphinx' .. deprecated:: directive; someone please provide a concrete example of what this looks like (for example, does this directive support multi-line content, and if so, what does that look like).</p>
<p dir="auto">Proposed content: summaries of deprecation schedule (in version number time, not real time) and justification for deprecation (e.g., being replaced, duplicates extant functionality elsewhere); existing alternatives to obtain the same functionality.  (Feel strongly that it should contain something else?  Add it below as a comment.)</p>
<p dir="auto">IMO, we should try to decide on this and update the standard by June 15 at the latest.</p>
<p dir="auto">Have I forgotten anything?</p>
<h3 dir="auto">Describe the issue:</h3>
<p dir="auto">I have a 4D array of shape [12, 11, 18, 3]. When I use np.arange() to do advanced indexing on the first and third dimensions, and index the 4th dimension with an integer, the return shape is [12, 11, 18], as expected. However, when I use np.arange() to do advanced indexing on the second dimension, the output shape is [11, 12, 18], which has the first and second dimensions transposed.</p>
<h3 dir="auto">Reproduce the code example:</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
voxels = np.zeros((12, 11, 18, 3))

print(voxels[np.arange(12), :, :, 0].shape)

print(voxels[:, np.arange(11), :, 1].shape)

print(voxels[:, :, np.arange(18), 2].shape)

print(np.version.version)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-s1">voxels</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">zeros</span>((<span class="pl-c1">12</span>, <span class="pl-c1">11</span>, <span class="pl-c1">18</span>, <span class="pl-c1">3</span>))

<span class="pl-en">print</span>(<span class="pl-s1">voxels</span>[<span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">12</span>), :, :, <span class="pl-c1">0</span>].<span class="pl-s1">shape</span>)

<span class="pl-en">print</span>(<span class="pl-s1">voxels</span>[:, <span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">11</span>), :, <span class="pl-c1">1</span>].<span class="pl-s1">shape</span>)

<span class="pl-en">print</span>(<span class="pl-s1">voxels</span>[:, :, <span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-c1">18</span>), <span class="pl-c1">2</span>].<span class="pl-s1">shape</span>)

<span class="pl-en">print</span>(<span class="pl-s1">np</span>.<span class="pl-s1">version</span>.<span class="pl-s1">version</span>)</pre></div>
<h3 dir="auto">Error message:</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Expected output:
(12, 11, 18)
(12, 11, 18)
(12, 11, 18)
Actual output:
(12, 11, 18)
**(11, 12, 18)**
(12, 11, 18)"><pre class="notranslate">Expected output:
(12, 11, 18)
(12, 11, 18)
(12, 11, 18)
Actual output:
(12, 11, 18)
<span class="pl-k">**</span>(11, 12, 18)<span class="pl-k">**</span>
(12, 11, 18)</pre></div>
<h3 dir="auto">Runtime information:</h3>
<p dir="auto">numpy 1.22.3</p>
<h3 dir="auto">Context for the issue:</h3>
<p dir="auto"><em>No response</em></p>