I am trying to modify the boolarr numpy array depending on the contents of the reducedMatrix array.
It is supposed to change the boolean value of the boolarr to False if reducedMatrix is not a 0 or a -1.
reducedMatrix = np.load(reducedweightmatrix)
boolarr = np.ones(shape=(len(reducedMatrix),len(reducedMatrix)),dtype="bool")
for y,yelement in enumerate(reducedMatrix):
for x,xelement in enumerate(yelement):
if(xelement != -1 and xelement != 0):
print(x)
print(y)
print("\n")
boolarr[y,x] == False
print(reducedMatrix)
print(boolarr)
The log keeps on showing the following:
[[-1 5 5 0 0]
[ 5 -1 0 0 0]
[ 5 0 -1 0 5]
[ 0 0 0 -1 0]
[ 0 0 5 0 -1]]
[[ True True True True True]
[ True True True True True]
[ True True True True True]
[ True True True True True]
[ True True True True True]]
What am I doing wrong?