[issue35904] Add statistics.fmean(seq)

Raymond Hettinger report at bugs.python.org
Fri Feb 8 12:56:04 EST 2019


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

+1 from me as well.

I like your count() solution because 1) it gives the same answer for both an iterator and for an iterable 2) it preserves the memory friendly characteristics of iterators, 3), it is still reasonably fast, and 4) the function signature is still simple.

My top name preference is "fmean" because I'm used to "isqrt" for integers, "fsqrt" for floats, and "cmath" for complex where the first letter means the type.  Incidentally, that is why "fsum" is named with an "f". My second choice is "fastmean" without an underscore.  To my ear, "float_mean" is confusing, as if "float" were a verb and "mean" were the direct object, the antonym of "sink_mean" ;-)

----------

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


More information about the Python-bugs-list mailing list