title: Numpy DeprecationWarning on boolean indexing
body: <p>This code</p>
  
  <pre><code>import numpy as np
  
  def some_method(y, threshold):
      print type(y), y.shape, y.dtype 
      c = np.zeros(y.shape)
      c[y &gt; threshold] = 1
  </code></pre>
  
  <p>Results in</p>
  
  <pre><code>&lt;type 'numpy.ndarray'&gt; (484L,) [('target', '&lt;f8')]
  DeprecationWarning: using a boolean instead of an integer will result in an error in the future
    c[y &gt; threshold] = 1
  </code></pre>
  
  <p>I can't find anything on this in Google nor in the numpy release notes. I'm assuming this is about indexing by booleans? I don't understand how this could possibly result in an error in the future, how can I fix this?</p>
  
  <p>Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win32</p>
  
  <p>Numpy version: 1.8.0</p>
  
  <p>EDIT: Added the print statement to the code to show the array is an ndarray</p>
  
  <p>EDIT2: From the comments it became clear that this happens because <code>y</code> is a struct array and the correct way to do the check is <code>y['target'] &gt; threshold</code>. However, <code>y</code> could have multiple columns, or even different column names, is there a way to do this flexibly with structured arrays?</p>