So I have a function iterating through a multidimensional numpy array and preforming a function on every item in the array, the funtion returns either True or False and I need to filter out all the items which return false:
def unhappy_grid(grid, empty_value=-1, threshold=3):
for y in grid:
for x in y:
if happy(grid, y, x, threshold).any() == False:
print('test')
return
Happy is the function that returns true or false but even after I use .any() it still gives me this error? I don't know what I am doing wrong here, can someone please explain how to fix this?