parse_Data_from_input: Tuple object has no attribute astype

*Reached up to Assignment 4 * Do help pls!!!
And an error again. What have I done :thinking:

There are a couple of mistakes in the function parse_data_from_file:

  1. Why do np.shape(28) ? This has to be fixed before moving further.
>>> import numpy as np
>>> np.shape(28)
  1. Converting an n-d array using astype doesn’t modify the underlying array. You have to capture the return value of the call.

Hi Sir,
Since they are asking us to reshape the arrays from 784 to 28*28 I have used np. reshape(28). Not sure if I’m doing it right. Pls bear with me (1).jpeg

I’m unable to view the 1st image. Please share your notebook via direct message with me if the section below still doesn’t make sense.

Taking a shot here without your code:
np.reshape takes an array as the 1st parameter and the desired shape as the 2nd parameter.
It’s important to capture the return value of np.reshape since it returns an array with new shape information / a new array with the desired shape.
Hope this helps.