title: ValueError: cannot reshape array of size 23760 into shape (240,1,28,28)
body: <pre><code># Reshape and normalize training data
  trainX = train[:, 1:].reshape(train.shape[0],1,28, 28).astype( 'float32' )
  x_train = trainX / 255.0
  
  y_train = train[:,98]
  
  # Reshape and normalize test data
  testX = test[:,1:].reshape(test.shape[0],1, 28, 28).astype( 'float32' )
  x_test = testX / 255.0
  
  y_test = test[:,98]
  </code></pre>
  
  <p>I try to reshape my csv train_data and test_data into 3-D Matrix but I get an error:</p>
  
  <pre><code>ValueError Traceback (most recent call last) 
  &lt;ipython-input-57-268af51a6b14&gt; in &lt;module&gt;()
  ----&gt; 1 trainX = train[:, 1:].reshape(train.shape[0],1,28, 28).astype( 'float32' )
        2 x_train = trainX / 255.0
        3
        4 y_train = train[:,98]
        5
  ValueError: cannot reshape array of size 23760 into shape (240,1,28,28)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/uJotn.png" rel="nofollow noreferrer">Error Report Screenshoot</a></p>