W3 How to use resize and add a new dimension to the training data

Continuing the discussion from C1 W3 Adding a dimension to training_data:

My code in the other post is an example of how to add an extra dimension to an ndarray. You’ll have to adapt that example to code the function reshape_and_normalize. For starters, use the images array in the function parameter instead of creating a random array of shape (3, 4)

1 Like

Sure sir. Can u give any material as to how to do this pls. I dont think it was mentioned in course material

Please read the markdown cell above the function reshape_and_normalize. Details for coding the function are provided there.

Thanks. I tried that. but still i am not getting the expected output. pls help

1 Like

reshape operation creates a new ndarray. So, you should assign the result back to images to get a reference to the transformed ndarray.


Ah! I get it. Thanks a lot.

Thank u so much sir. I will definitely try and let u know

Got it. Thanks again for the support sir