On Sun, Nov 21, 2010 at 19:49, Keith Goodman <[email protected]> wrote:

> But this sample gives a difference:
>
>>> a = np.random.rand(100)
>>> a.var()
>   0.080232196646619805
>>> var(a)
>   0.080232196646619791
>
> As you know, I'm trying to make a drop-in replacement for
> scipy.stats.nanstd. Maybe I'll have to add an asterisk to the drop-in
> part. Either that, or suck it up and store the damn mean.

The difference is less than eps. Quite possibly, the one-pass version
is even closer to the true value than the two-pass version.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to