I want to create an n-by-2 NumPy array, and then test whether it contains a particular 1-by-2 array (i.e. whether it contains a particular row).
Here is my code:
x = np.array([0, 1])
y = np.array([2, 3])
z = np.vstack((x, y))
if x in z:
print "Yes"
But this gives me the error:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Please could somebody explain this to me? Thanks!