title: Filter numpy array by two conditions. More than one element is ambiguous
body: <p>I have a numpy array which I need to filter and perform a sum on. Similar to my <a href="https://stackoverflow.com/questions/26289292/filter-and-sum-different-columns-in-a-numpy-array">previous question</a>, although this one needs to be filtered by two conditions.</p>
  
  <p>Need to return the sum of column <code>7</code> where column <code>0 == ptype</code> AND column <code>8 == radius</code>.</p>
  
  <pre><code>np.sum(data[data[:,0] == ptype and data[data[:,8] &lt;= radius],7])
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
  </code></pre>
  
  <p>Any ideas?</p>