title: Removing NaN rows from a three dimensional array
body: <p>How can I remove the <code>NaN</code> rows from the array below using indices (since I will need to remove the same rows from a different array.</p>
  
  <pre><code>array([[[nan,  0.,  0.,  0.],
          [ 0.,  0.,  0.,  0.],
          [ 0.,  0.,  0.,  0.]],
  
         [[ 0.,  0.,  0.,  0.],
          [ 0., nan,  0.,  0.],
          [ 0.,  0.,  0.,  0.]]])
  </code></pre>
  
  <p>I get the indices of the rows to be removed by using the command</p>
  
  <pre><code>a[np.isnan(a).any(axis=2)]
  </code></pre>
  
  <p>But using what I would normally use on a 2D array does not produce the desired result, losing the array structure.</p>
  
  <pre><code>a[~np.isnan(a).any(axis=2)]
  array([[0., 0., 0., 0.],
         [0., 0., 0., 0.],
         [0., 0., 0., 0.],
         [0., 0., 0., 0.]])
  </code></pre>
  
  <p>How can I remove the rows I want using the indices obtained from my first command?</p>