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