I have two lists of frequencies, one observed and one modeled. It turns out that I want to find all the values closest to those observed within the model. The first has length of 38 and the second of 303. I did the following
def find_nearest(array,value):
return np.abs(array-value)).argmin()
indices = []
for k in range(0,len(observadas)):
np.append(indices, find_nearest(modeladas,observadas[k])
print(indices)
I tested individually some of the ones observed within the models, and there are ... But what I did returns [] Suggestions?