Why does ddof=2 and ddof=3 give the same result?
np.var([1, 2, 3], ddof=0) 0.66666666666666663 np.var([1, 2, 3], ddof=1) 1.0 np.var([1, 2, 3], ddof=2) 2.0 np.var([1, 2, 3], ddof=3) 2.0 np.var([1, 2, 3], ddof=4) -2.0
I expected NaN for ddof=3.
On Fri, Dec 10, 2010 at 4:42 PM, Keith Goodman <kwgoodman@gmail.com> wrote:
Why does ddof=2 and ddof=3 give the same result?
np.var([1, 2, 3], ddof=0) 0.66666666666666663 np.var([1, 2, 3], ddof=1) 1.0 np.var([1, 2, 3], ddof=2) 2.0 np.var([1, 2, 3], ddof=3) 2.0 np.var([1, 2, 3], ddof=4) -2.0
I expected NaN for ddof=3.
It's a floating point calculation, so I would expect np.inf Josef
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Fri, Dec 10, 2010 at 2:26 PM, <josef.pktd@gmail.com> wrote:
On Fri, Dec 10, 2010 at 4:42 PM, Keith Goodman <kwgoodman@gmail.com> wrote:
Why does ddof=2 and ddof=3 give the same result?
np.var([1, 2, 3], ddof=0) 0.66666666666666663 np.var([1, 2, 3], ddof=1) 1.0 np.var([1, 2, 3], ddof=2) 2.0 np.var([1, 2, 3], ddof=3) 2.0 np.var([1, 2, 3], ddof=4) -2.0
I expected NaN for ddof=3.
It's a floating point calculation, so I would expect np.inf
Right, NAFN (F=Finite). Unless, of course, the numerator is zero too.
participants (2)
-
josef.pktd@gmail.com
-
Keith Goodman