title: Proper way to "append" multi-dimensional numpy arrays?
body: <p>I have a 4d array <code>x</code>, for which I want to loop through the first axis, modify that 3d array, and add this modified array to a new 4d array <code>y</code>.</p>
  
  <p>I am currently doing something like:</p>
  
  <pre><code>xmod = modify(x[0, :, :, :])
  y = xmod.reshape(1, x.shape[1], x.shape[2], x.shape[3])
  for i in range(1, x.shape[0]):
      xmod = modify(x[i, :, :, :])
      y = np.vstack((y, xmod))
  </code></pre>
  
  <p>I am guessing there is amuch cleaner to do this. How?</p>