x1 = np.array([0, 1, 0, 1, 0, 1, 0, 1, 1, 1])
y = np.array([-1, -1, -1, -1, -1, 1, 1, 1, 1, -1])
I know with these 2 arrays you can sum up the amount of times exact indicies are equal with numpy in this line of code.
np.sum(x1 == y)
but is there a way to sum up each time the same index equals a specific value on each array such as
np.sum(x1 == 1 && y == -1)
Unfortunately this line of code doesn't run, but if it worked the result should be 3.