Re: [Numpy-discussion] numpy.mean still broken for large float32 arrays
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]
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@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@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
participants (2)
-
Jeff Reback
-
RayS