Slice a 3d numpy array using a 1d lookup between indices
Slice a 3d numpy array using a 1d lookup between indices import numpy as np a = np.arange(12).reshape(2, 3, 2) b = np.array([2, 0]) b maps i to j where i and j are the first 2 indexes of a, so a[i,j,…