title: Import and reshape MNIST data, numpy
body: <p>I want to reshape the MNIST dataset from shape  (70000, 784) to (70000, 28, 28), the following code is tryed, but it gets a TypeError:</p>
  
  <p>TypeError: only integer scalar arrays can be converted to a scalar index</p>
  
  <pre><code>df = pd.read_csv('images.csv', sep=',', header=None)
  x_data = np.array(df)
  
  x_data = x_data.reshape(x_data[0], 28, 28)
  </code></pre>
  
  <p>This works, but is slow</p>
  
  <pre><code>data = np.array(df)
  x_data = []
  
  for d in data:
      x_data.append(d.reshape(28,28))
  
  x_data = np.array(x_data)
  </code></pre>
  
  <p>How should this be with numpy.reshape() and without looping?
  Manny thanks!</p>