there is someting confusing me:
a = np.array([7,8,9,10])
b=[[3,1],[1,2]]
print(a[b])
"""
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed
"""
but transform b=[[3,1],[1,2]] to:
b=np.array([[3,1],[1,2]])
print(a[b])
"""
array([[10, 8],
[ 8, 9]])
"""
okay, someone know why b must be a ndarray instead of list? thanks.