title: Space seprated values to ndarray
body: <p>I am trying to have a data set imported for my machine learning model.
  Data is of images stored as values of pixels of each image.
  Image size is 48X48.
  I need to convert this to ndarray but as its space separated so </p>
  
  <p><code>X = data[:, 1].reshape(data.shape[0],1,48, 48).astype( 'float32' )</code></p>
  
  <p>doesn't work.
  I need help in converting this data to ndarray of(nX48X48).(n->no. of rows.)
  EDIT:-
  I tried,</p>
  
  <pre><code>`data=pd.read_csv('../input/fer2013.csv').values
  X=data[:,1]
  for i in range(len(X)):
         X[i]=np.asarray(X[i].split(" "),dtype=np.float32)
         X[i]=X[i].reshape(1,48,48).astype('float32')`
  </code></pre>
  
  <p>It does not change shape of column.
  I wish the shape of X to be(n,1,48,48)
  But doing above keeps the shape to be(n).<a href="https://i.stack.imgur.com/Ss7Yk.png" rel="nofollow noreferrer">sample row of data</a></p>
  
  <p>Format of data:
  <a href="https://i.stack.imgur.com/RAEZl.png" rel="nofollow noreferrer">pixels column of dataset</a></p>
  
  <p>Thanks and regards,</p>