I have a problem accessing the data in a multidimensional numpy-array with python 2.7. The goal is to read multiple values whose positions are stored in a list.
import numpy as np
matrix=np.ones((10,30,5))
positions=[]
positions.append([1,2,3])
positions.append([4,5,6])
for i in positions:
print matrix[i]
What I want is:
print matrix[1,2,3]
But I get:
print [matrix[1], matrix[2], matrix[3]]
Could you please give me a hint for the correct indexing? Thanks!