title: Loading image dataset in numpy arrays in python
body: <p>I have 6 different images. I want to store them together in a single numpy array. Is that possible? If yes, how can I do that?</p>
  
  <pre class="lang-py prettyprint-override"><code>from PIL import Image
  from matplotlib import image
  import matplotlib.pyplot as plt
  from os import listdir
  from numpy import asarray
  import numpy as np
  
  for i in range(1,6):
      image=Image.open(str(i)+'.jpg')
      image=image.resize((100,100))
      temp=asarray(image)
      print(np.append(X_train,temp,axis=0))
  </code></pre>
  
  <p>This raises the following Exception:</p>
  
  <blockquote>
    <p>ValueError: all the input arrays must have same number of dimensions</p>
  </blockquote>