[Numpy-discussion] 3D array slicing bug?

Pauli Virtanen pav at iki.fi
Thu Mar 22 05:23:38 EDT 2018


ke, 2018-03-21 kello 20:40 +0000, Michael Himes kirjoitti:
> I have discovered what I believe is a bug with array slicing
> involving 3D (and higher) dimension arrays. When slicing a 3D array
> by a single value for axis 0, all values for axis 1, and a list to
> slice axis 2, the dimensionality of the resulting 2D array is
> flipped.

https://docs.scipy.org/doc/numpy/reference/arrays.indexing.html#combining-advanced-and-basic-indexing

The key part seems to be: "There are two parts to the indexing
operation, the subspace defined by the basic indexing 
(**excluding integers**) and the subspace from the advanced indexing
part."


More information about the NumPy-Discussion mailing list