>>> np.isin(np.array([1,2,3]), [1,2]) array([ True, True, False]) >>> np.array([1,2,3]) in [1,2] Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()