I am attempting to extract values from a 3d numpy array. At the moment I can perform the following operations:
newmesh.shape
(40,40,40)
newmesh[2,5,6]
6
However, if I try to index it with an array, the result is not as expected;
newmesh[np.array([2,5,6])].shape
(3, 42, 42)
I have tried using np.take, however it produces the following;
np.take(newmesh,np.array([2,5,6]))
[-1 -1 -1]
Any ideas why this is happening? My goal is to input a (n,3) array, where each row corresponds to a value of newmesh, i.e. inputting a (n,3) array would give back a 1d array of length n.