A have 4D array M( a x b x c x d) and Iindex array ( 3 x f), e.g.
I = np.array([1,2,3, ...], [2,1,3, ...], [4,1,6, ...])
I would like to use Ito get a matrix Xthat has frows and columns d, where:
X[0,:] = M[1,2,4,:]
X[1,:] = M[2,1,1,:]
X[2,:] = M[3,3,6,:]
...
I know what I can use M[I[0], I[1], I[2]], but I was wondering if there is a more concise solution?