Exercise 8 - Building model

For the Week 2 project, everything before Exercise 8 is correct.
It says ‘dict’ object not callable.

I have :
w = params(“w”)
b = params(“b”)

Thanks for the help

The correct syntax for indexing an array or dictionary in python uses square brackets, not parentheses. You’re not by any chance a MATLAB programmer? :nerd_face:

1 Like

Thanks. I had just noticed that from looking at the other responses.
Now, it is saying tuple index out of range for the Y_prediction_test part.

Also, I have used MATLAB and R for a lot of projects in the past.

Well, the other thing that is different about python vs MATLAB is that indexing in python is 0-based, right? So if I have an array that is 1 x 5 then myArray[1,5] will give you “out of range” errors. The last element of that row vector is myArray[0,4].

But the principles of debugging are the same no matter the language: the first rule is “believe the error message”. If you don’t understand what it is saying, that is the first problem you need to solve :nerd_face: … But in this case, one would hope the meaning is pretty clear.

1 Like