I am trying to index an np.array using list and np.array indexes. But they give different result.
Here is an illustration:
import numpy
From numpy indexing documentation:
ndarrays can be indexed using the standard Python
x[obj]syntax, wherexis the array andobjthe selection....
Basic slicing occurs when obj is a slice object (constructed bystart:stop:stepnotation inside of brackets), an integer, or a tuple ofsliceobjects and integers.Ellipsisandnewaxisobjects can be interspersed with these as well. In order to remain backward compatible with a common usage in Numeric, basic slicing is also initiated if the selection object is any non-ndarray sequence (such as alist) containingsliceobjects, theEllipsisobject, or thenewaxisobject, but not for integer arrays or other embedded sequences. ...