title: Maximum and minimum values numpy Array
body: <p>if I have an array like </p>
  
  <pre><code>z = np.random.random((41,61,106))
  y,x=np.mgrid[slice(0,61, 1),slice(0,106, 1)] 
  z=z[_num,x,y]]
  </code></pre>
  
  <p>Who I can capture the 10 maximum and 10 minimum and mask the rest of the values in a array z.</p>
  
  <p>And, it is posible take the midle of the max and the min values an put another 10 values.</p>
  
  <pre><code> middle=sorted[(len(sorted)/2)-5:(len(sorted)/2)+5]
   print middle
   mask = ma.masked_inside(z,sorted[10],sorted[-10],middle)
   print mask
  </code></pre>