Syntax error I can't understand

Can you please format your code by surrounding it with triple backticks (```)? We can’t tell what it’s supposed to be without proper indentation.

What I think @MRAB was asking is what you expect a statement of the form a = a += b to do. That’s what it looks you you wrote in the original exception message (though it’s hard to be sure without proper formatting). Curiously there doesn’t seem to be a line matching that in the second code snippet you posted, so I’d recommend double checking that you properly saved the file / re-ran any previous cells after editing.