I am trying to sort the values โโin a numpy array so that I can store all the values โโthat are in a certain range (this can probably be formulated better). In any case, I am not showing a good example of what I'm trying to do. I have an array called cells that looks like this:
bins = array([11,11.5,12,12.5,13,13.5,14])
I also have another array called avgs:
avgs = array([11.02, 13.67, 11.78, 12.34, 13.24, 12.98, 11.3, 12.56, 13.95, 13.56, 11.64, 12.45, 13.23, 13.64, 12.46, 11.01, 11.87, 12.34, 13,87, 13.04, 12.49, 12.5])
What I'm trying to do is find the index values โโof the avgs array, which are in the ranges between the values โโof the bins array. For example, I tried to create a while loop that would create new variables for each bean. The first bunker will be everything between bins[0] and bins[1] and will look like this:
bin1 = array([0, 6, 15])
These index values โโwill correspond to values โโ11.02, 11.3 and 11.01 in avgs and there will be avgs values โโthat were between index values โโ0 and 1 in bins . I also need other bins, so another example:
bin2 = array([2, 10, 16])
However, the difficult part for me was that the size of bins and avgs changes depending on other parameters, so I tried to create something that could be expanded to larger or smaller bins and avgs arrays.