1
votes

I have a sorted array of float numbers ranging from 0 to 1. The goal is to generate a random number (r) between the same range and determine between which two numbers from the array (r) lie. I tried "(np.abs(array - value)).argmin()" but it gives the nearest number which sometimes is the larger one and others is the smaller one.