title: Batch operation to all matrices stored in a n-dimensional numpy array
body: <p>I have a numpy array of size (4, 4, 6890), which basically stores contains 6890 4x4 matrices. I need to invert all of them and I am currently doing in a loop, which I know is a bad practice</p>
  
  <pre><code>for i in range(0, T.shape[2]):
      T_inv[:,:,i] = np.linalg.inv(T[:,:,i])
  </code></pre>
  
  <p>How can I do it with a single call? </p>