In clean, unclaimed Python, I can use
>>> a = 9
>>> b = [5, 7, 12]
>>> a in b
False
I would like to do something similar for arrays in Numpy ie
>>> a = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
>>> b = np.array([5, 7, 12])
>>> a in b
np.array([False, False, False, False, True, False, True, False, False, False])
... although this does not work.
Is there a function or method that achieve this? If this is not the easiest way to do this?
source
share