<h3 dir="auto">Reproducing code example:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
In [118]: import numpy as np                                                                                                                                                                  

In [119]: a = np.random.random((5,6,7))                                                                                                                                                       

In [120]: a[0, :, [1,2]].shape                                                                                                                                                                
Out[120]: (2, 6)"><pre class="notranslate"><code class="notranslate">
In [118]: import numpy as np                                                                                                                                                                  

In [119]: a = np.random.random((5,6,7))                                                                                                                                                       

In [120]: a[0, :, [1,2]].shape                                                                                                                                                                
Out[120]: (2, 6)
</code></pre></div>
<p dir="auto">one would expect shape <code class="notranslate">(6, 2)</code>...</p>
<p dir="auto">Seems to occur only if the first index is set to a unique index and the last one to an iterable of indices</p>
<h3 dir="auto">NumPy/Python version information:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [121]: import sys, numpy; print(numpy.__version__, sys.version)                                                                                                                            
1.18.1 3.7.5 (default, Oct 25 2019, 15:51:11) 
[GCC 7.3.0]"><pre class="notranslate"><code class="notranslate">In [121]: import sys, numpy; print(numpy.__version__, sys.version)                                                                                                                            
1.18.1 3.7.5 (default, Oct 25 2019, 15:51:11) 
[GCC 7.3.0]
</code></pre></div>
<p dir="auto">Please see the code.</p>
<h3 dir="auto">Reproducing 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
x = np.random.rand(4, 5, 4)
x[0, :, [1,2]].shape  # output (2, 5)    # my expectation is (5, 2)
x[0][:, [1,2]].shape  # outout (5, 2)"><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">x</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">rand</span>(<span class="pl-c1">4</span>, <span class="pl-c1">5</span>, <span class="pl-c1">4</span>)
<span class="pl-s1">x</span>[<span class="pl-c1">0</span>, :, [<span class="pl-c1">1</span>,<span class="pl-c1">2</span>]].<span class="pl-s1">shape</span>  <span class="pl-c"># output (2, 5)    # my expectation is (5, 2)</span>
<span class="pl-s1">x</span>[<span class="pl-c1">0</span>][:, [<span class="pl-c1">1</span>,<span class="pl-c1">2</span>]].<span class="pl-s1">shape</span>  <span class="pl-c"># outout (5, 2)</span></pre></div>
<h3 dir="auto">Numpy/Python version information:</h3>

<p dir="auto">numpy version: 1.19.1,<br>
sys.version: 3.7.0 (default, Oct  9 2018, 10:31:47) \n[GCC 7.3.0]</p>