title: How can I run a numpy function percentile() on a masked array?
body: <p>I try to retrieve percentiles from an array with NoData values. In my case the Nodata values are represented by -3.40282347e+38. I thought a masked array would exclude this values from further calculations. I succesfully create the masked array but for the np.percentile() function the mask has no effect.</p>
  
  <pre><code>&gt;&gt;&gt; DataArray = np.array(data)
  &gt;&gt;&gt; DataArray
  
  ([[ value, value...]], dtype=float32)
  
  &gt;&gt;&gt; masked_data = ma.masked_where(DataArray &lt; 0, DataArray)
  &gt;&gt;&gt; p5 = np.percentile(masked_data, 5)
  &gt;&gt;&gt; print p5
  
   -3.40282347e+38
  </code></pre>