Hi Olivier, Please don't top post, it isn't the custom on this list.
On Wed, Nov 21, 2012 at 7:22 PM, Olivier Delalleau <[email protected]> wrote: > Current behavior looks sensible to me. I personally would prefer no > warning but I think it makes sense to have one as it can be helpful to > detect issues faster. > > -=- Olivier > > 2012/11/21 Charles R Harris <[email protected]> > >> What should be the value of the mean, var, and std of empty arrays? >> Currently >> >> In [12]: a >> Out[12]: array([], dtype=int64) >> >> In [13]: a.mean() >> Out[13]: nan >> >> In [14]: a.std() >> Out[14]: nan >> >> In [15]: a.var() >> Out[15]: nan >> >> I think the nan comes from 0/0. All of these also raise warnings the >> first time they are called. >> >> The warnings vary and don't directly give information on the cause, i.e., empty arrays. If we do go with warnings I think they should be more specific. Chuck
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
