I have a list of matrix indices and want to access a matrix by these indices.
Example:
indices = [(2, 0), (2, 1), (2, 2)]
mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
mat[indices] = 0
This should result in [[1, 2, 3], [4, 5, 6], [0, 0, 0]], but unfortunately I always get "list indices must be integers, not list".
EDIT
As user2357112 suggests in his comment I tried the following now:
mat = numpy.array(mat)
indices = numpy.array(indices)
mat[indices] = 0
But unfortunately the whole matrix is filled with 0 now.
np.arrayon your matrices.