[Numpy-discussion] numpy.mean still broken for large float32 arrays

Jeff Reback jeffreback at gmail.com
Thu Jul 24 15:25:06 EDT 2014


related recent issue: https://github.com/numpy/numpy/issues/4638
and pandas is now explicitly specifying the accumulator to avoid this
problem: https://github.com/pydata/pandas/pull/6954/files

pandas also implemented the Welfords method for rolling_var in 0.14.0, see
here: https://github.com/pydata/pandas/pull/6817


On Thu, Jul 24, 2014 at 3:05 PM, RayS <rays at blue-cove.com> wrote:

> Probably a number of scipy places as well
>
>
>
> import numpy
> import scipy.stats
> print numpy.__version__
> print scipy.__version__
> for s in range(16777214, 16777944):
>      if scipy.stats.nanmean(numpy.ones((s, 1), numpy.float32))[0]!=1:
>          print '\nbroke', s, scipy.stats.nanmean(numpy.ones((s, 1),
> numpy.float32))
>          break
>      else:
>          print '\r',s,
>
> c:\temp>python np_sum.py
> 1.8.0b2
> 0.11.0
> 16777216
> broke 16777217 [ 0.99999994]
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140724/1d7f5c59/attachment.html>


More information about the NumPy-Discussion mailing list