I have an array x and a list of filters (array of booleans same length as x):
x = np.random.rand(10)
filt1 = x > .2
filt2 = x < .5
filt3 = x % 2 > .02
filters_list = [filt1, filt2, filt3]
I want to create a filter that is the logical AND of all filters in filters_list
so the output should be
output = x[filt1 & filt2 & filt3]
How do I create the filter filt1 & filt2 & filt3
from filters_list
assuming len(filters_list)
is arbitrary?