I want to find a float in a arry like this:
arr = np.asarray([1351.1 , 1351.11, 1351.14, 1351.16, 1351.17])
index = np.searchsorted(arr, 1351.14, side="right") - 1 # return 2
But I find that it return wrong like this:
index = np.searchsorted(arr, 1351.1 + 0.04, side="right") - 1 # return 1
Because I want to search value like this:
indexes = np.searchsorted(arr, arr[0] + np.arange(10) * 0.01, side="right") - 1 # this will be wrong because of the problem above