We noticed that the mixed usage of fancy indexing and slicing is so confusing and undocumented for multi-dimensional arrays, for example:
In [114]: x = np.arange(720).reshape((2,3,4,5,6))
In [115]: x[:,:,:,0,[0,1,2,4,5]].shape
Out[115]: (2, 3, 4, 5)
In [116]: x[:,:,0,:,[0,1,2,4,5]].shape
Out[116]: (5, 2, 3, 5)
I have read the usage of fancy indexing on https://numpy.org/doc/stable/user/basics.indexing.html and I can understand that x[:,0,:,[1,2]] = [x[:,0,:,1], x[:,0,:,2]]
. However I cannot understand why the result for above Input [115]
and Input [116]
differ on the first dimension. Can someone point to where such broadcasting rules are documented?
Thanks!
I have tried searching the documentation for fancy indexing as well as posting issues to the numpy repo on Github.