[Numpy-discussion] What should be the result in some statistics corner cases?

Benjamin Root ben.root at ou.edu
Mon Jul 15 20:58:48 EDT 2013


To add a bit of context to the question of nansum on empty results, we
currently differ from MATLAB and R in this respect, they return zero no
matter what. Personally, I think it should return zero, but our current
behavior of returning nans has existed for a long time.

Personally, I think we need a deprecation warning and possibly wait to
change this until 2.0, with plenty of warning that this will change.

Ben Root
On Jul 15, 2013 8:46 PM, "Charles R Harris" <charlesr.harris at gmail.com>
wrote:

>
>
> On Mon, Jul 15, 2013 at 6:22 PM, Stéfan van der Walt <stefan at sun.ac.za>wrote:
>
>> On Mon, 15 Jul 2013 08:33:47 -0600, Charles R Harris wrote:
>> > On Mon, Jul 15, 2013 at 8:25 AM, Benjamin Root <ben.root at ou.edu> wrote:
>> >
>> > > This is going to need to be heavily documented with doctests. Also,
>> just
>> > > to clarify, are we talking about a ValueError for doing a nansum on an
>> > > empty array as well, or will that now return a zero?
>> > >
>> > >
>> > I was going to leave nansum as is, as it seems that the result was by
>> > choice rather than by accident.
>>
>> That makes sense--I like Sebastian's explanation whereby operations that
>> define an identity yields that upon empty input.
>>
>
> So nansum should return zeros rather than the current NaNs?
>
> Chuck
>
> _______________________________________________
> 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/20130715/2d36bd97/attachment.html>


More information about the NumPy-Discussion mailing list