<p dir="auto">Found from <a href="https://dev.azure.com/numpy/numpy/_build/results?buildId=9539&amp;view=logs&amp;j=25bb66cf-4a16-533e-490c-8da4b5a3ec04&amp;t=8c35b800-042e-5b95-ac32-a97341040f78&amp;l=3639" rel="nofollow">a CI run</a>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  Running from numpy source directory.
  c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
    warnings.warn(msg)
  Traceback (most recent call last):
    File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_vendor\pep517\_in_process.py&quot;, line 280, in &lt;module&gt;
      main()
    File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_vendor\pep517\_in_process.py&quot;, line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_vendor\pep517\_in_process.py&quot;, line 205, in build_wheel
      metadata_directory)
    File &quot;C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\build_meta.py&quot;, line 213, in build_wheel
      wheel_directory, config_settings)
    File &quot;C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\build_meta.py&quot;, line 198, in _build_with_temp_dir
      self.run_setup()
    File &quot;C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\build_meta.py&quot;, line 250, in run_setup
      self).run_setup(setup_script=setup_script)
    File &quot;C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\build_meta.py&quot;, line 143, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File &quot;setup.py&quot;, line 488, in &lt;module&gt;
      setup_package()
    File &quot;setup.py&quot;, line 480, in setup_package
      setup(**metadata)
    File &quot;D:\a\1\s\numpy\distutils\core.py&quot;, line 169, in setup
      return old_setup(**new_attr)
    File &quot;C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\__init__.py&quot;, line 144, in setup
      return distutils.core.setup(**attrs)
    File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\core.py&quot;, line 148, in setup
      dist.run_commands()
    File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py&quot;, line 955, in run_commands
      self.run_command(cmd)
    File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py&quot;, line 974, in run_command
      cmd_obj.run()
    File &quot;C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\wheel\bdist_wheel.py&quot;, line 223, in run
      self.run_command('build')
    File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\cmd.py&quot;, line 313, in run_command
      self.distribution.run_command(command)
    File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py&quot;, line 974, in run_command
      cmd_obj.run()
    File &quot;D:\a\1\s\numpy\distutils\command\build.py&quot;, line 40, in run
      old_build.run(self)
    File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\command\build.py&quot;, line 135, in run
      self.run_command(cmd_name)
    File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\cmd.py&quot;, line 313, in run_command
      self.distribution.run_command(command)
    File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py&quot;, line 974, in run_command
      cmd_obj.run()
    File &quot;D:\a\1\s\numpy\distutils\command\build_ext.py&quot;, line 272, in run
      self.build_extensions()
    File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\command\build_ext.py&quot;, line 448, in build_extensions
      self._build_extensions_serial()
    File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\command\build_ext.py&quot;, line 473, in _build_extensions_serial
      self.build_extension(ext)
    File &quot;setup.py&quot;, line 260, in build_extension
      build_ext.build_extension(self, ext)
    File &quot;D:\a\1\s\numpy\distutils\command\build_ext.py&quot;, line 478, in build_extension
      unlinkable_fobjects)
    File &quot;D:\a\1\s\numpy\distutils\command\build_ext.py&quot;, line 523, in _process_unlinkable_fobjects
      fobjects = [os.path.relpath(obj) for obj in unlinkable_fobjects]
    File &quot;D:\a\1\s\numpy\distutils\command\build_ext.py&quot;, line 523, in &lt;listcomp&gt;
      fobjects = [os.path.relpath(obj) for obj in unlinkable_fobjects]
    File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\ntpath.py&quot;, line 584, in relpath
      path_drive, start_drive))
  ValueError: path is on mount 'c:', start on mount 'D:'
  ERROR: Failed building wheel for numpy
  Building wheel for numpy (PEP 517): finished with status 'error'
Failed to build numpy
ERROR: Failed to build one or more wheels
Exception information:
Traceback (most recent call last):
  File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_internal\cli\base_command.py&quot;, line 188, in _main
    status = self.run(options, args)
  File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_internal\cli\req_command.py&quot;, line 185, in wrapper
    return func(self, options, args)
  File &quot;c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_internal\commands\wheel.py&quot;, line 189, in run
    &quot;Failed to build one or more wheels&quot;
pip._internal.exceptions.CommandError: Failed to build one or more wheels"><pre class="notranslate"><code class="notranslate">  Running from numpy source directory.
  c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
    warnings.warn(msg)
  Traceback (most recent call last):
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in &lt;module&gt;
      main()
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 205, in build_wheel
      metadata_directory)
    File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\build_meta.py", line 213, in build_wheel
      wheel_directory, config_settings)
    File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\build_meta.py", line 198, in _build_with_temp_dir
      self.run_setup()
    File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\build_meta.py", line 250, in run_setup
      self).run_setup(setup_script=setup_script)
    File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\build_meta.py", line 143, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 488, in &lt;module&gt;
      setup_package()
    File "setup.py", line 480, in setup_package
      setup(**metadata)
    File "D:\a\1\s\numpy\distutils\core.py", line 169, in setup
      return old_setup(**new_attr)
    File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\setuptools\__init__.py", line 144, in setup
      return distutils.core.setup(**attrs)
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-build-env-4zqwivu4\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "D:\a\1\s\numpy\distutils\command\build.py", line 40, in run
      old_build.run(self)
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "D:\a\1\s\numpy\distutils\command\build_ext.py", line 272, in run
      self.build_extensions()
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\command\build_ext.py", line 448, in build_extensions
      self._build_extensions_serial()
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\distutils\command\build_ext.py", line 473, in _build_extensions_serial
      self.build_extension(ext)
    File "setup.py", line 260, in build_extension
      build_ext.build_extension(self, ext)
    File "D:\a\1\s\numpy\distutils\command\build_ext.py", line 478, in build_extension
      unlinkable_fobjects)
    File "D:\a\1\s\numpy\distutils\command\build_ext.py", line 523, in _process_unlinkable_fobjects
      fobjects = [os.path.relpath(obj) for obj in unlinkable_fobjects]
    File "D:\a\1\s\numpy\distutils\command\build_ext.py", line 523, in &lt;listcomp&gt;
      fobjects = [os.path.relpath(obj) for obj in unlinkable_fobjects]
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\ntpath.py", line 584, in relpath
      path_drive, start_drive))
  ValueError: path is on mount 'c:', start on mount 'D:'
  ERROR: Failed building wheel for numpy
  Building wheel for numpy (PEP 517): finished with status 'error'
Failed to build numpy
ERROR: Failed to build one or more wheels
Exception information:
Traceback (most recent call last):
  File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in _main
    status = self.run(options, args)
  File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_internal\cli\req_command.py", line 185, in wrapper
    return func(self, options, args)
  File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\site-packages\pip\_internal\commands\wheel.py", line 189, in run
    "Failed to build one or more wheels"
pip._internal.exceptions.CommandError: Failed to build one or more wheels
</code></pre></div>
<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="&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; a = np.ndarray((5,6,7))
&gt;&gt;&gt; a.shape
(5, 6, 7)
&gt;&gt;&gt; a[[[0,1]],[[0],[1],[2]],:].shape
(3, 2, 7)
&gt;&gt;&gt; a[:,[[0,1]],[[0],[1],[2]]].shape
(5, 3, 2)
&gt;&gt;&gt; a[[[0,1]],:,[[0],[1],[2]]].shape
(3, 2, 6)"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <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-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">ndarray</span>((<span class="pl-c1">5</span>,<span class="pl-c1">6</span>,<span class="pl-c1">7</span>))
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">a</span>.<span class="pl-s1">shape</span>
(<span class="pl-c1">5</span>, <span class="pl-c1">6</span>, <span class="pl-c1">7</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">a</span>[[[<span class="pl-c1">0</span>,<span class="pl-c1">1</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-c1">3</span>, <span class="pl-c1">2</span>, <span class="pl-c1">7</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">a</span>[:,[[<span class="pl-c1">0</span>,<span class="pl-c1">1</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-c1">5</span>, <span class="pl-c1">3</span>, <span class="pl-c1">2</span>)
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">a</span>[[[<span class="pl-c1">0</span>,<span class="pl-c1">1</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-c1">3</span>, <span class="pl-c1">2</span>, <span class="pl-c1">6</span>)</pre></div>
<p dir="auto">I think the outcome of the third example is unexpected and inconsistent having seen the first two.  I it would be more consistent either have the index dimensions <code class="notranslate">(3,2)</code> always be first, or preserve location of the "free" coordinate <code class="notranslate">:</code> to obtain a shape of <code class="notranslate">(3,6,2)</code>.</p>
<h3 dir="auto">Numpy/Python version information:</h3>

<p dir="auto">1.19.1 3.8.4 (default, Jul 14 2020, 11:50:51)<br>
[GCC 10.1.1 20200507 (Red Hat 10.1.1-1)]</p>