I have 2 numpy arrays with the same shape. Now I want to compare the values of array 1 with array 2. Finally, the sum of the matches with the condition value == 1 is to be output.

array 1:

```
[1, 0, 1]
[1, 1, 0]
[0, 0, 1]

```

array 2:

```
[0, 1, 1]
[1, 0, 0]
[0, 1, 1]

```

The result should now look like this:

```
sum = 3

```

-------------------------
-------------------------

My following algorithm is working but isn't very performant and elegant:

```
k = 0
for i in range(0,array1.shape[0],1):
    for j in range(0, array1.shape[1], 1):

        if array1[i][j] == array2[i][j] and array1[i][j] == 1:
            k = k + 1
        else:
            continue

print k

```