I'm doing a comparison between the elements of two matrices and a third matrix (whether two elements from the two first matrices are situated in the same columns of the third matrix together) and if that so, I wanted it to break from the "if" ones the condition is verified but it does not do that even when I break it.
A=np.array([['A','T','W','S'],
['H','R','W','Q'],
['P','E','Z','A'],
['Y','U','O','W'],
['T','I','P','V'],
['R','A','M','G'],
['V','K','J','F']])
PR=np.array(
[['E'],
['R'],
['A'],
['M'],
['K'],
['L']])
CLU=np.array(
[ ['A','X','A','M'],
['R','D','S','L'],
['E','F','E','B'],
['T','J','R','R'],
['L','Y','G','A'],
['M','R','H','D'],
['P','T','N','C']])
n=[[],[],[],[]]
for i in range (len(PR)):
for j in range (0,len(A.T)):
for u in range (0,7):
for k in range (0,len(CLU.T)-1):
if PR[i] in CLU.T[k] and A[u][j] in CLU.T[k]:
n[k]=np.append(n[k], 1)
break
else:
n[k]=np.append(n[k], 0)
print(n)
'''