[issue20479] Efficiently support weight/frequency mappings in the statistics module

Oscar Benjamin report at bugs.python.org
Sun Jan 20 16:17:11 EST 2019


Oscar Benjamin <oscar.j.benjamin at gmail.com> added the comment:

Sorry, sent too soon...

> Matlab doesn't support even weighted mean as far as I can tell. There
> is wmean on the matlab file exchange:
https://stackoverflow.com/a/36464881/9450991

This is a separate function `wmean(data, weights)`. It has to be a
separate function though because it's third party code so the author
couldn't change the main mean function.

R ships with a weighted.mean function but I think for standard
deviation you need third party libs.

A quick survey but the main impression I get is that providing API for
this is not that common. The only good-looking API is the statsmodel
one.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20479>
_______________________________________


More information about the Python-bugs-list mailing list