title: How can I perform the following computation in a more elegant (and Pythonic) way?
body: <p>Given the object <code>data</code>, which is of type <code>numpy.ndarray</code>, how can I perform the following in one line?</p>
  
  <pre><code>VERY_LOW = np.where(data&lt;=-2, 'VERY_LOW', 'LOL').astype('S12') 
  LOW = np.where((data&gt;-2) &amp; (data&lt;=-1), 'LOW', VERY_LOW)
  AVERAGE = np.where((data&gt;-1) &amp; (data&lt;+1), 'AVERAGE', LOW)
  HIGH = np.where((data&gt;=+1) &amp; (data&lt;+2), 'HIGH', AVERAGE)
  VERY_HIGH = np.where(data&gt;=+2, 'VERY_HIGH', HIGH)
  </code></pre>
  
  <p>Basically, what I am trying to achieve is to assign a tag to each cell depending on its value (one out of five available).</p>