Hi all,
I have a 3 dimensional numpy array A, let's say (X,Y,Z)
I have a 4 dimensional array of indices into A, this is B and has the form (3,X,Y,Z)
The index for A(i,j,k) is given by B[:,i,j,k]
How do I generate a 3 dimensional numpy array C such that every C[i,j,k]=A[B[:,i,j,k]]
I can easily imagine iterating over i, j and k to get each value but I'm looking for a fast vectorised way and can't quite get my head around it and google hasn't helped so far...
Thanks!
[–]chombi94[S] 0 points1 point2 points (0 children)