I would like to set some values of a 2D array to a specific number by indexing them efficiently.
Say I have a 2D numpy array,
A = array([[1, 6, 6],
           [9, 7, 7], 
           [10, 2, 2]])
and I would like to get the indices in the array that belong to a set of numbers, say indList=[10, 1] so that I can set them to zero. However, indList can be a huge list.
Is there a faster way for doing this without a for loop?
As a for loop it would be,
indList = [10, 1]
for i in indList:
    A[A==i] = 0
But this can get inefficient when indList is large.



3x3array.