Theta_minus is invalid syntax

Where ever I type theta_minus I get an invalid syntax error. What could be wrong?

File “”, line 48
theta_minus = np.copy(parameters_values)
^
SyntaxError: invalid syntax

Please check to make sure the parentheses match on the previous line. I’ll bet you are missing a close paren.

1 Like

You may think that behavior of the python interpreter is weird, but think about how it works: it gets to the end of the previous line and knows that the syntax is incomplete. So it to proceeds forward to the next line hoping to find the completion that it is waiting for. Then when it sees something that conflicts with the completion that it’s looking for, that is where it “throws”.

You are right! Thanks very much! I must have tried typing various things there for an hour.

The “meta” lesson here is that when you’re stuck on something like that it probably means you are looking in the wrong place or just have the wrong concept about what is wrong. It’s a sign that you need to step back and consider a new theory.

Reminds me of the old joke about the person looking for their keys in the front yard. When someone asks “where were you when you last can remember having your keys”. The answer is “in the house”. “Why are you looking in the front yard then?” “Because the light is better here.” :laughing: