[Numpy-discussion] Weighted percentile / quantile
jfoxrabinovitz at gmail.com
Tue Mar 1 22:27:05 EST 2016
At the moment, there does not appear to be anything in numpy. However,
I am working (slowly) on upgrading the C code for partitioning with
arbitrary arrays of real weights. That will get `partition`, `median`,
`percentile` to work with weights, as well as enabling weights for the
automated bin estimators of `histogram`. `mean` already has an
implementation of weights via `average`.
You may be interested in my original post to the mailing list here:
Josef P. mentioned in one of his responses that statsmodels has a
weighted quantile computation available as of PR 2707:
https://github.com/statsmodels/statsmodels/pull/2707. That should
effectively serve your purpose.
On Tue, Mar 1, 2016 at 6:03 PM, Alex Rogozhnikov
<alex.rogozhnikov at yandex.ru> wrote:
> I know the topic was already raised a long ago:
> There are also several questions on SO:
> The only working solution with numpy:
> uses sorting.
> Are there better options at the moment (numpy/scipy/pandas)?
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
More information about the NumPy-Discussion