Is In Simple
import numpy as np
a = np.array([
[1, 2],
[3, 4]
])
a
array([[1, 2],
[3, 4]])
b = [1, 1, 5, 3]
c = np.isin(a, b)
c
array([[ True, False],
[ True, False]])
# Invert can be done as well
d = np.isin(a, b, invert=True)
d
array([[False, True],
[False, True]])