I'm using numpy for the first time. I am trying to achieve the following:
There are 2 arrays:
a = np.array([[1, 3], [2, 5], [1, 2], [2, 1], [1,6]])
b = np.array([[3, 5], [1, 2]])
I need to check if ANY pair (or a row in other words) in array b is present in array a, in the same order (as in, [1, 2] is not to be considered same as [2, 1])
The above example should return True since both a and b contain [1, 2]
I've tried:
for [x, y] in b
if [x, y] in a
and:
if (a == b).all(1).any() # --> This throws "AttributeError: 'bool' object has no attribute 'all'"
but failed.
Thanks in advance