I have the following array:
[[4 9]
[5 4]
...
[2 9]]
I want to filter this arr array, in a way, that I only have the elements of it, where both elements are between 0 and 7, and discard the rest. My solution, so far, has been to create a filter array, to index it with:
filter_array = ((arr >= 0) & (arr <= 7))
My problem is, this returns an array of the same shape as arr:
[[ True False]
[ True True]
...
[ True False]]
Which I can't use to index the original array in the way that I want. I want to discard the entire line, if any of the elements are not between the values I want:
#desired output:
[ False
True
...
False ]
I want to solve this in a "numpy-ish" manner, since the array is quite large, so performance is important. (I don't want to just iterate over it with some for loops)