title: What is the best way to dynamically increase a numpy array in Python?
body: <p>Say we have an incoming stream of data of size (1,N), it is a numpy array</p>
  
  <pre><code>read_data = [[foo, foo_1, foo_2]]
  </code></pre>
  
  <p>And we want to do something with that or simply append it to a larger array.</p>
  
  <pre><code>data=np.vstack((data,real_data)) (or whatever method you choose)
  </code></pre>
  
  <p>My trouble usually comes in the fact that I do not know the dimensions of the incoming data, so what I sometimes do, is:</p>
  
  <ul>
  <li>I generate a buffer with the known dimensions and start populating it.</li>
  <li>I generate a first trash read, either empty or with zeros and just append over it, and then erase it.</li>
  </ul>
  
  <p>In matlab this is very easy, since it dynamically creates the array you need as soon as you give data (although is not recommended to do)</p>
  
  <p>What is the best way to do it in python?</p>