[Numpy-discussion] [pydata] Re: [SciPy-Dev] 1.8.0rc1

Charles R Harris charlesr.harris at gmail.com
Tue Oct 1 10:13:37 EDT 2013


On Tue, Oct 1, 2013 at 7:58 AM, Nathaniel Smith <njs at pobox.com> wrote:

> I bet the difference is:
>
> In master, nansum ultimately calls arr.sum(...), which will be
> intercepted by Series.sum.
>
> In 1.8.x, nansum ultimately calls np.add.reduce(...), which can't be
> intercepted and will return the wrong thing.
>
> AFAICT the np.add.reduce(a, ...) call could just be replaced with
> a.sum(...), but I might be missing something... surely there must have
> been some reason it was written that way in the first place?
>

No good reason, just a bit more efficient. The change for current master
was because of the change in nansum behavior for empty slices. Changing the
call to a.sum is not a problem, although I confess that it seems a bit
fragile...

<snip>

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20131001/689a2067/attachment.html>


More information about the NumPy-Discussion mailing list