title: How to vstack efficiently a sequence of large numpy array chunks?
body: <p>I am generating a sequence of numpy arrays as follows:</p>
  
  <pre><code>def chunker(seq, size):
      return (seq[pos:pos + size] for pos in range(0, len(seq), size))
  
  for i in chunker(X,10000):
      e = function(i)
      print('new marix',e)
  
  new matrix (10000, 3208)
  new matrix (10000, 3208)
  new matrix (10000, 3208)
  new matrix (10000, 3208)
  new matrix (10000, 3208)
  new matrix (10000, 3208)
  new matrix (10000, 3208)
  new matrix (10000, 3208)
  ...
  new matrix (10000, 3208)
  </code></pre>
  
  <p>I would like to <a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.vstack.html" rel="nofollow">vstack</a> the above <code>n</code> matrices in a single one. Thus, I tried the following:</p>
  
  <pre><code>    X = np.vstack(e)
  </code></pre>
  
  <p>However, when I print <code>X</code> I am getting again:</p>
  
  <pre><code>new matrix (10000, 3208)
  new matrix (10000, 3208)
  new matrix (10000, 3208)
  new matrix (10000, 3208)
  new matrix (10000, 3208)
  new matrix (10000, 3208)
  new matrix (10000, 3208)
  new matrix (10000, 3208)
  ...
  new matrix (10000, 3208)
  </code></pre>
  
  <p>Instead of a new vstacked single matrix. Any idea of how to vstack this sequence of numpy arrays?.</p>
  
  <p><strong>Update</strong></p>
  
  <p>From jedward's answer I edited my code as follows:</p>
  
  <p>import numpy as np</p>
  
  <pre><code>def chunker(seq, size):
      return (seq[pos:pos + size] for pos in range(0, len(seq), size))
  
  for (r,i) in enumerate(chunker(X,10000)):
      e = function(i)
      print('new matrix',e)
      X[r,:] = e
  
  print(X)
  </code></pre>