If I have an array
>>> a=np.array([[1,2,1],[3,4,2],[6,5,3],[7,8,4]])
>>> a
array([[1, 2, 1],
[3, 4, 2],
[6, 5, 3],
[7, 8, 4]])
and I want to find if first column which have value=6 and if second column have value=5 using "IF" "ELSE"
I try with:
b=6
c=5
if (b in a[:,0]) and (c in a[:,1]):
print ('yes')
else:
print ('no')
the result is 'yes', but when I change b=7 and c=5, it still say 'yes'.. What's is missing from my code?