title: How to get any columns of a rank N tensor?
body: <p>Consider the tensor</p>
  
  <pre><code>import numpy as np
  array = np.array([
      [[111, 112], [121, 122]],
      [[211, 212], [221, 222]],
  ])
  
  &gt;&gt;&gt; print(array[:, 0, [0, 1]])
  [
   [111 112]
   [211 212]
  ]
  
  &gt;&gt;&gt; print(array[:, 1, [0, 1]])
  [
   [121 122]
   [221 222]
  ]
  </code></pre>
  
  <p>Now, how would I get the elements <code>(:, 0, 1)</code>, and <code>(:, 1, 0)</code>,</p>
  
  <pre><code>[
   [112 121]
   [212 221]
  ]
  </code></pre>
  
  <p>as a numpy ndarray as above?</p>
  
  <p>It seems that</p>
  
  <pre><code>&gt;&gt;&gt; print(array[:, [(1, 0), (0, 1)]])
  </code></pre>
  
  <p>is not the correct notation. </p>
  
  <p>Generally, given a list of tuples of indexes, how do I get an N-1 tensor of those tuples (-1 because the first rank is always <code>:</code> here)?</p>
  
  <p>If numpy does not support it, I am willing to use a library other than numpy to do this.</p>