title: How to filter values of numpy ndarray based on a boolean mask?
body: <p>I have a numpy ndarray of shape (172,40,20) and a boolean mask of shape (172, 20). I can do it with a loop.</p>
  
  <pre><code>for i in range(172):
       filtered_values = array[i,:,mask[i]]
  </code></pre>
  
  <p>Is there any other way to do this without using loop?</p>