def scoreatpercentile(data, percentile):
 per = np.array(percentile)
 cdf = empiricalcdf(data)
 interpolator = interpolate.interp1d(np.sort(cdf), np.sort(data))
 return interpolator((per / 100.0))

def scoreatpercentile ( data , percentile ) : per = np . array ( percentile ) cdf = empiricalcdf ( data ) interpolator = interpolate . interp1d ( np . sort ( cdf ) , np . sort ( data ) ) return interpolator ( ( per / 100.0 ) )
calculate the score at the given per percentile of the sequence a .