Why is statistics.mean() so slow?
Python’s statistics module is not built for speed, but for precision In the specs for this module, it appears that The built-in sum can lose accuracy when dealing with floats of wildly differing magnitude. Consequently, the above naive mean fails this “torture test” assert mean([1e30, 1, 3, -1e30]) == 1 returning 0 instead of 1, … Read more