title: How can I add new dimensions to a Numpy array?
body: <p>I'm starting off with a numpy array of an image.</p>
  
  <pre><code>In[1]:img = cv2.imread('test.jpg')
  </code></pre>
  
  <p>The shape is what you might expect for a 640x480 RGB image.</p>
  
  <pre><code>In[2]:img.shape
  Out[2]: (480, 640, 3)
  </code></pre>
  
  <p>However, this image that I have is a frame of a video, which is 100 frames long. Ideally, I would like to have a single array that contains all the data from this video such that <code>img.shape</code> returns <code>(480, 640, 3, 100)</code>.</p>
  
  <p>What is the best way to add the next frame -- that is, the next set of image data, another 480 x 640 x 3 array -- to my initial array?</p>