W2_A2_Ex-4_datatype error

{Moderator’s Edit: Solution Code Removed}

Hey @Deepak_Kumar_suman,
Welcome and we are glad that you could be a part of our community :partying_face: The thing to note here is how we pass in the shape to the np.zeros() method. The shape is passed as a tuple, so if you want an array of shape (dim, 1), you have to pass this as a tuple, not as individual elements. As of now, it is taking 1 as the value for the second argument, which is dtype, and hence, the error.

For more information about the same, you can check out the documentation here.

P.S. - Posting solution code publicly is strictly against the community guidelines. Please refrain from doing so in the future. You are more than welcome to share your error stack, as in the later part of the image.


Hey @Rashmi,
Let me know once you are done. I will remove the solution code afterwards.


Hello Deepak Kumar Suman,

Welcome to the community.

The value of b should be a float value, but 0 is an integer. Now how can you make 0, a float value, you have to think a bit.