title: How to rotate 90 deg of 2D array inside 3D array?
body: <p>I have a 3D array consist of 2D arrays, I want to rotate only the 2D arrays inside the 3D array without changing the order, so it will become a 3D array consist of rotated 3D arrays.</p>
  <p>For example, I have a 3D array like this.</p>
  <pre><code>foo = np.array([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]])
  print(foo)
  &gt;&gt;&gt; array([[[ 1,  2,  3],
              [ 4,  5,  6]],
  
             [[ 7,  8,  9],
              [10, 11, 12]]])
  foo.shape
  &gt;&gt;&gt; (2, 2, 3)
  </code></pre>
  <p>I want to rotate it into this.</p>
  <pre><code>rotated_foo = np.array([[[4, 1], [5, 2], [6, 3]], [[10, 7], [11, 8], [12, 9]]])
  print(rotated_foo)
  &gt;&gt;&gt; array([[[ 4,  1],
              [ 5,  2],
              [ 6,  3]],
  
             [[10,  7],
              [11,  8],
              [12,  9]]])
  rotated_foo.shape
  &gt;&gt;&gt; (2, 3, 2)
  </code></pre>
  <p>I've tried it using numpy's rot90 but I got something like this.</p>
  <pre><code>rotated_foo = np.rot90(foo)
  print(rotated_foo)
  &gt;&gt;&gt; array([[[ 4,  5,  6],
              [10, 11, 12]],
  
             [[ 1,  2,  3],
              [ 7,  8,  9]]])
  rotated_foo.shape
  &gt;&gt;&gt; (2, 2, 3)
  </code></pre>