I need to find which percentile of a group of numbers is over a threshold value. Is there a way that this can be speed up? My implementation is much too slow for the intended application. In case this changes anything, I am running my program using `mpirun -np 100 python program.py`. I cannot use numba, as the rest of this program uses try/except statements. import numpy as np my_vals = [] threshold_val = 0.065 for i in range(60000): my_vals.append(np.random.normal(0.05, 0.02)) for i in np.arange(0,100,0.001): if np.percentile(my_vals,i) > threshold_val: perc = 1*i break else: perc = 100