title: matplotlib hist while ignoring a particular no data value
body: <p>I've got a 2D numpy array with 1.0e6 as the no data value.  I'd like to generate a histogram of the data and while I've succeeded this can't be the best way to do it.</p>
  
  <pre><code>from matplotlib import pyplot
  import sys
  
  eps = sys.float_info.epsilon
  no_data = 1.0e6
  
  e_data = elevation.reshape(elevation.size)
  e_data_clean = [ ]
  
  for i in xrange(len(e_data)):
      val = e_data[i]
      # floating point equality check for val aprox not equal no_data
      if val &gt; no_data + eps and val &lt; no_data - eps:
          e_data_clean.append(val)
  
  pyplot.hist(e_data_clean, bins=100)
  </code></pre>
  
  <p>It seems like there should be a clean (and much faster one liner for this).  Is there?</p>