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

Oscar Benjamin report at bugs.python.org
Sun Feb 2 13:12:32 CET 2014


Oscar Benjamin added the comment:

On 2 February 2014 11:55, Steven D'Aprano <report at bugs.python.org> wrote:
>
> (1) separate functions, as Nick suggests:
> mean vs weighted_mean, stdev vs weighted_stdev

This would be my preferred approach. It makes it very clear which
functions are available for working with map style data. It will be
clear from both the module documentation and a casual introspection of
the module that those APIs are present for those who might want them.
Also apart from mode() the implementation of each function on
map-format data will be completely different from the iterable version
so you'd want to have it as a separate function at least internally
anyway.

----------

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


More information about the Python-bugs-list mailing list