*{moderator edit - solution code removed}*

course 1: week 4: exercise one

I keep getting TYPE ERROR: Data type not understood

*{moderator edit - solution code removed}*

course 1: week 4: exercise one

I keep getting TYPE ERROR: Data type not understood

That is not the correct syntax for invoking `np.zeros`

. It is different from the syntax for `np.random.randn`

. Why you ask? Because. Seriously. This is the joy of Open Source Software: there is no overarching conceptual model. It just â€śis what it isâ€ť. You just need to read the documentation and â€śdeal with itâ€ť.

The point is that the `shape`

value that they show in the instructions is a python â€śtupleâ€ť that gives the dimensions. Youâ€™ve given a list of dimensions, which is why it throws that error.

1 Like

Alright. still. I need a hint.

Do you know what a â€śtupleâ€ť is in python? Hereâ€™s the docpage, which I found by googling â€śnumpy zerosâ€ť. It takes a single argument which is a â€śtupleâ€ť giving the desired dimensions.

Also weâ€™ve used `np.zeros`

before, right? Did you pass the `initialize_with_zeros`

function in the Week 2 Logistic Regression assignment? We also used it in `initialize_parameters`

in the Week 3 Planar Data assignment.

Actually Iâ€™ve realized my mistake. Iâ€™ve fixed it now. All good. Thank YOu