[issue24068] statistics module - incorrect results with boolean input

Mark Dickinson report at bugs.python.org
Sun May 3 08:09:27 CEST 2015


Mark Dickinson added the comment:

> I wonder if it would be better to reject Bool data in this context?

It's not uncommon (and quite useful) in NumPy world to compute basic statistics on arrays of boolean dtype: the sum of such an array gives a count of the `True`s, and the mean gives the proportion of `True` entries.  I think it would be handy to allow the statistics module to work with lists of bools, if possible.

----------
nosy: +mark.dickinson

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


More information about the Python-bugs-list mailing list