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

Steven D'Aprano report at bugs.python.org
Sun Feb 2 12:55:18 CET 2014


Steven D'Aprano added the comment:

Off the top of my head, I can think of three APIs:

(1) separate functions, as Nick suggests:
mean vs weighted_mean, stdev vs weighted_stdev

(2) treat mappings as an implied (value, frequency) pairs

(3) take an additional argument to switch between unweighted and weighted modes.

I dislike #3, but will consider the others for 3.5.

----------
assignee:  -> stevenjd

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


More information about the Python-bugs-list mailing list