Is there a way to use the numpy.percentile function to compute weighted percentile? Or is anyone aware of an alternative python function to compute weighted percentile?
As mentioned in comments, simply repeating values is impossible for float weights, and impractical for very large datasets. There is a library that does weighted percentiles here:
http://kochanski.org/gpk/code/speechresearch/gmisclib/gmisclib.weighted_percentile-module.html
It worked for me.