Wolfgang Maier added the comment:
Fixed as part of resolving issue 25177.
--
resolution: -> fixed
stage: test needed -> resolved
status: open -> closed
___
Python tracker
Changes by Matteo Dell'Amico de...@linux.it:
--
nosy: +della
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24068
___
___
Python-bugs-list mailing
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24068
___
___
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
Wolfgang Maier added the comment:
uploading an alternate, possibly slightly clearer version of the patch
--
Added file: http://bugs.python.org/file39269/statistics._sum.v2.patch
___
Python tracker rep...@bugs.python.org
R. David Murray added the comment:
I wonder if it would be better to reject Bool data in this context? Bool is
only a numeric type for historical reasons.
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
Steven D'Aprano added the comment:
The patch seems simple and straightforward enough. It just needs some tests,
and a Round Tuit.
--
assignee: - steven.daprano
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24068
Changes by Steven D'Aprano steve+pyt...@pearwood.info:
--
stage: - test needed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24068
___
___
Changes by Wolfgang Maier wolfgang.ma...@biologie.uni-freiburg.de:
Removed file: http://bugs.python.org/file39220/statistics._sum.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24068
___
Changes by Wolfgang Maier wolfgang.ma...@biologie.uni-freiburg.de:
Added file: http://bugs.python.org/file39221/statistics._sum.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24068
___
New submission from Wolfgang Maier:
the mean function in the statistics module gives nonsensical results with
boolean values in the input, e.g.:
mean([True, True, False, False])
0.25
mean([True, 1027])
0.5
This is an issue with the module's internal _sum function that mean relies on.
11 matches
Mail list logo