title: Get indices of array where two conditions (on different arrays) are true
body: <p>I have two numpy arrays: <code>a</code> and <code>b</code>. I want to select all of the indices where <code>a == 1</code> and <code>b == 0</code>.</p>
  
  <p>That is, if I have the following arrays:</p>
  
  <pre><code>a = [0, 1, 3, 5, 1, 1, 2]
  
  b = [1, 0, 2, 5, 3, 0, 6]
  </code></pre>
  
  <p>I would like to get the following indices back:</p>
  
  <pre><code>[1, 5]
  </code></pre>
  
  <p>How should I do this in numpy? I have tried using the following (suggested by a quick reference guide showing differences between numpy, matlab and IDL):</p>
  
  <pre><code>(a == 1 and b == 0).nonzero()
  </code></pre>
  
  <p>But that gives an error about truth values being ambiguous.</p>
  
  <p>Any ideas?</p>