So I've essentially split an array#1(full of float values) into 100 arrays contained in a list, and what I want to do is compare it to an array#2(also full of floats) and have the program give me the number of values in array#2 that fall within the range of each of the 100 arrays in the list.
I may not have explained it well enough, but I've done this successfully for the first two arrays however I can't find a way to do it elegantly through a 'for' loop so I don't have to type it out 100 times.
Here's the code:
manual_bins_threshim = np.array_split(threshim_by_size, 100)
def count(rand, l, r):      
   return len(list(i for i in rand if l <= i <= r))
a = np.array(manual_bins_threshim[0:1])
l = a[:][0][0]
r = a[:][0][len(a[:][0]) -1]
a_1 = count(array2, l, r)
b = np.array(manual_bins_threshim[1:2])
l = b[:][0][0]
r = b[:][0][len(b[:][0]) -1]
b_1 = count(array2, l, r)
print(a_1,b_1)
I'm also open to a function that can do this in a different way if I've made it way more complicated than it needs to be.
