title: Filter a 2D numpy array
body: <p>I want to have a sub array (between min and max) of a numpy 2D ndarray</p>
  
  <pre><code>    xy_dat = get_xydata()
      x_displayed = xy_dat[((xy_dat &gt; min) &amp; (xy_dat &lt; max))]
  </code></pre>
  
  <p>min and max are float in order to be compare with the first value of the array xy_dat</p>
  
  <p>xy_dat is a 2D numpy array :</p>
  
  <pre><code>[[ 735964.            1020.        ]
   [ 735964.04166667    1020.        ]
   [ 735964.08333333    1020.        ]
   ..., 
   [ 736613.39722222    1095.        ]
   [ 736613.40416667    1100.        ]
   [ 736613.41111111    1105.        ]]
  </code></pre>
  
  <p>x_displayed is correctly filtered but I have lost the second value (it is now a 1D array) :</p>
  
  <pre><code>[ 735964.04166667  735964.08333333  735964.125      
   ...,  
  736613.39027778  736613.39722222  736613.40416667]
  </code></pre>
  
  <p>How make the filter on the first value and keep the other ?</p>