Notice that you’re working harder than you need to by rewriting the logic of the sigmoid function by hand. You just built that as a function, so the point of that was that you can then call it when you need sigmoid.
But notice that the parentheses do not match on that line: there are 5 open parens and only 4 close parens. That’s why it throws that syntax error on the next line. If you can’t find a syntax error in python, it usually means you are looking in the wrong place.
If it throws an error at the beginning of a line, it usually means there is something incomplete about the previous line.
Also note that you don’t need to apply np.array to something that is already a numpy array … It does no harm, but it’s a waste of effort. Why write more code than you need to?