Percentile shouldn't implictly be quantile
This line is a bug waiting to happen. If the function is percentile it should behave as such. If the weights are not set, then the np.percentile method is used and it will give different results. Suggest removing this.