title: How can I filter an array with 3 dimensions in numpy
body: <p>I know this is one of the easiest task in numpy but I don't get it. I have an array:</p>
  
  <pre><code>import numpy as np
  
  u1 = np.array([[[-2.04853845, -1.47283101,  1.        ],
                  [-2.05009646, -1.46780913,  1.        ],
                  [-2.05165539, -1.46278426,  1.        ]],
                 [[-4.94165412,  7.8524744 ,  1.        ],
                  [ 0.94540647,   0.86456925,  1.       ],
                  [-4.94916228,  7.87667525,  1.        ]]])
  </code></pre>
  
  <p>u1 is a summary of the matrix. The real size of the matrix is:</p>
  
  <pre><code>u1.shape
  (813, 1200, 3)
  </code></pre>
  
  <p>I want to get all the values where the first and the second element of last array (last dimension) is between 0 and 1, so I get and array containing boolean so I can index another array with the same shape.</p>
  
  <p>I bet this is a duplicate question, but I didn't find it. Thanks</p>