According the NumPy tutorial, the correct way to do it is:
a[tuple(b)]
More Related Contents:
- Using numpy to build an array of all combinations of two arrays
- Difference between numpy.array shape (R, 1) and (R,)
- Intuition and idea behind reshaping 4D array to 2D array in NumPy
- How does numpy.newaxis work and when to use it?
- What is the difference between flatten and ravel functions in numpy?
- Calculate mean across dimension in a 2D array
- Concatenate Numpy arrays without copying
- How do I count the occurrence of a certain item in an ndarray?
- Selecting specific rows and columns from NumPy array
- Swap slices of Numpy arrays
- How do I use np.newaxis?
- Convert a 1D array to a 2D array in numpy
- Vectorized NumPy linspace for multiple start and stop values
- Subsetting a 2D numpy array
- Check if two 3D numpy arrays contain overlapping 2D arrays
- How to split a numpy array in fixed size chunks with and without overlap?
- What is the difference between ndarray and array in NumPy?
- remove zero lines 2-D numpy array
- Why using an array as an index changes the shape of a multidimensional ndarray?
- What is the purpose of meshgrid in Python / NumPy?
- numpy reverse multidimensional array
- 3d Numpy array to 2d
- Vectorized spatial distance in python using numpy
- Good ways to “expand” a numpy ndarray?
- Axes from plt.subplots() is a “numpy.ndarray” object and has no attribute “plot”
- python tilde unary operator as negation numpy bool array
- Python: how to store a numpy multidimensional array in PyTables?
- Why is B = numpy.dot(A,x) so much slower looping through doing B[i,:,:] = numpy.dot(A[i,:,:],x) )?
- Access n-th dimension in python [duplicate]
- Mapping a NumPy array in place