title: Python - read images into image matrix
body: <p>I am trying to read multiple rgb images into one matrix, such that the matrix dimensions are (image_size, image_size, index) e.g. data[:,:,1] should retrieve the 1st image. </p>
  
  <pre><code>data = np.zeros((image_dim, image_dim, numImages), dtype=np.float64)
  for fname in os.listdir('images/sample_images/'):
         name='....'
         image=mpimg.imread(name)
         data = np.append(data, image)
  return data
  </code></pre>
  
  <p>image.shape = (512, 512, 3)
  data.shape = (512, 512, 100)</p>
  
  <p>Apart from the fact that np.append leaves me with an empty data array, is there another way of appending the image-array values to a big data matrix?</p>
  
  <p>Thanks in advance</p>