Closed
Description
Reproducing code example:
>>> import numpy as np
>>> a = np.ndarray((5,6,7))
>>> a.shape
(5, 6, 7)
>>> a[[[0,1]],[[0],[1],[2]],:].shape
(3, 2, 7)
>>> a[:,[[0,1]],[[0],[1],[2]]].shape
(5, 3, 2)
>>> a[[[0,1]],:,[[0],[1],[2]]].shape
(3, 2, 6)
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 (3,2)
always be first, or preserve location of the "free" coordinate :
to obtain a shape of (3,6,2)
.
Numpy/Python version information:
1.19.1 3.8.4 (default, Jul 14 2020, 11:50:51)
[GCC 10.1.1 20200507 (Red Hat 10.1.1-1)]
Metadata
Metadata
Assignees
Labels
No labels