Hi I am writing some long code so I will post a snippet of it here. Basically I have made an iterative code that builds a matrix of zeros, and a number that appears somewhere within those zeros to act as a radar. I only wanted the radar to update when there had been a change, so I set Radar1 equal to the old value of the radar, then put this function in
if Radar1.all() == Radar.all():
print('yes')
print(Radar)
print(Radar1)
else:
print('no')
Here is the output As can be seen in the picture, the response is yes, both matrices are the same, then both matrices are printed, and one of them (Radar) is all zeros, whereas the other one (Radar1) has a 3 in the 3rd row down and 3rd column across. My point is they are two different matrices, and they are not the same, so why doesn't my code print no? Maybe I am missing something, thanks for the help in advance
Edit: I have tried to run a similar loop in a standalone code to make it easier to edit, and it works, but still can't get it to work in my main code. I am very confused: Standalone code Perhaps its because im using global variables in the main code? Any help would be appreciated