I have tried multiple forms for dw and always get a syntax error. Can someone help?
Thank you.
File “”, line 44
dw = (1 / m) * np.dot(X, np.subtract(A, Y).T)
^
SyntaxError: invalid syntax
I have tried multiple forms for dw and always get a syntax error. Can someone help?
Thank you.
File “”, line 44
dw = (1 / m) * np.dot(X, np.subtract(A, Y).T)
^
SyntaxError: invalid syntax
Please check the shapes of X, A and Y to ensure that they are compatible and that your indentation is correct. It’s possible that the notebook might be corrupt. Follow these instructions to refresh the workspace
A closing parenthesis is missing.
@Kic
Please check again.
Hi @Patrick_Osmer, @balaji.ambresh
What I meant was to check the missing parenthesis from previous line of code. I was away from my laptop, giving a rather short answer.
Thanks for the clarification.
Exactly. That type of syntax error at the beginning of a line is almost always incomplete syntax on the previous line or perhaps an indentation error. But in python, indentation errors are always identified as such at least in my experience. If it’s just a generic “syntax error”, then the first thing to look for is a missing a closing delimiter on the previous line.
Thanks to all of you for your comments and suggestions. As a result I was able to complete Exercise 5 and pass the tests, i.e., get the right values for the parameters.
Indeed the main problem was the missing delimiter in my cost equation. Plus I had to sort out and learn better the shapes of the different arrays/vectors and how to use the appropriate operators.
This is my first time writing python/numpy code and correspondingly I have made many mistakes. Thus your assistance is invaluable. Thanks again.