how to detect a sign change for elements in a numpy array,"array([0, 0, 1, 0, 0, 1, 0])"