title: NumPy List Comprehension Syntax
body: <p>I'd like to be able to use list comprehension syntax to work with NumPy arrays easily.</p>
  
  <p>For instance, I would like something like the below obviously wrong code to just reproduce the same array.</p>
  
  <pre><code>&gt;&gt;&gt; X = np.random.randn(8,4)
  &gt;&gt;&gt; [[X[i,j] for i in X] for j in X[i]]
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  IndexError: arrays used as indices must be of integer (or boolean) type
  </code></pre>
  
  <p>What is the easy way to do this, to avoid using <code>range(len(X)</code>?</p>