title: How should I use Numpy's vstack method?
body: <p>Firstly, here is the relevant part of the code:</p>
  
  <pre><code>stokes_list = np.zeros(shape=(numrows,1024)) # 'numrows' defined earlier
  for i in range(numrows):
      epoch_name = y['filename'][i] # 'y' is an array from earlier
      os.system('pdv -t {0} &gt; temp.txt '.format(epoch_name)) # 'pdv' is a command from another piece of software - here I copy the output into a temporary file
      stokes_line = np.genfromtxt('temp.txt', usecols=3, dtype=[('stokesI','float')], skip_header=1)
      stokes_list = np.vstack((stokes_line,stokes_line))
  </code></pre>
  
  <p>So, basically, every time the code loops around, <code>stokes_line</code> pulls one of the columns (4th one) from the file <code>temp.txt</code>, and I want it to add a line to <code>stokes_list</code> each time. </p>
  
  <p>For example, if the first <code>stokes_line</code> is</p>
  
  <pre><code>1.1 2.2 3.3  
  </code></pre>
  
  <p>and the second is  </p>
  
  <pre><code>4.4 5.5 6.6  
  </code></pre>
  
  <p>then <code>stokes_list</code> will be  </p>
  
  <pre><code>1.1 2.2 3.3  
  4.4 5.5 6.6  
  </code></pre>
  
  <p>and will keep growing...  </p>
  
  <p>It's not working at the moment, because I think that the line:  </p>
  
  <pre><code>stokes_list = np.vstack((stokes_line,stokes_line))
  </code></pre>
  
  <p>is not correct. It's only stacking 2 lists - which makes sense as I only have 2 arguments. I basically would like to know how I keep stacking again and again.</p>
  
  <p>Any help would be very gratefully received!<br>
  If it is needed, here is an example of the format of the temp.txt file:</p>
  
  <pre><code>File: t091110_065921.SFTC Src: J1903+0925 Nsub: 1 Nch: 1 Npol: 4 Nbin: 1024 RMS: 0.00118753  
  0 0 0 0.00148099 -0.00143755 0.000931365 -0.00296775  
  0 0 1 0.000647476 -0.000896698 0.000171287 0.00218597  
  0 0 2 0.000704697 -0.00052846 -0.000603842 -0.000868739  
  0 0 3 0.000773361 -0.00234724 -0.0004112 0.00358033  
  0 0 4 0.00101559 -0.000691062 0.000196023 -0.000163109  
  0 0 5 -0.000220367 -0.000944024 0.000181002 -0.00268215  
  0 0 6 0.000311783 0.00191545 -0.00143816 -0.00213856  
  </code></pre>