title: Obtain a submatrix of a NumPy ndarray using a generator expression
body: <p>I want to obtain a submatrix of a NumPy <code>ndarray</code> using <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ix_.html" rel="nofollow noreferrer"><code>numpy.ix_</code></a> and a sequence of indexes from a generator expression. In the following toy example, why does this not work:</p>
  
  <pre><code>import numpy as np
  
  m = np.arange(25).reshape((5, 5))
  ind = (i for i in range(0, 6, 2))
  m[np.ix_(ind, ind)]
  </code></pre>
  
  <p>throwing a <code>ValueError: Cross index must be 1 dimensional</code>, whereas, using a list comprehension:</p>
  
  <pre><code>ind = [i for i in range(0, 6, 2)]
  m[np.ix_(ind, ind)]
  </code></pre>
  
  <p>produces the expected result:</p>
  
  <pre><code>array([[ 0,  2,  4],
         [10, 12, 14],
         [20, 22, 24]])
  </code></pre>