[NumPy-Tickets] [NumPy] #1123: nansum for empty or all nan arrays is not zero

NumPy Trac numpy-tickets@scipy....
Sat Jul 16 14:52:29 CDT 2011


#1123: nansum for empty or all nan arrays is not zero
-----------------------+----------------------------------------------------
 Reporter:  josefpktd  |       Owner:  charris     
     Type:  defect     |      Status:  needs_review
 Priority:  normal     |   Milestone:  2.0.0       
Component:  numpy.lib  |     Version:              
 Keywords:             |  
-----------------------+----------------------------------------------------

Comment(by mhearne):

 I opened this ticket two years (and an unknown number of numpy revisions)
 ago, and it's still being discussed.  May I sum up the arguments to have
 this changed?

 1) The documentation for the function says "Return the sum of array
 elements over a given axis treating Not a Numbers (NaNs) as zero."  It
 does not say that this depends on the presence or absence of real numbers.
 2) The sum() function returns NaN if there are NaNs in your array, if that
 behavior is what you want.
 3) At least two other languages (Matlab, R) have implemented a similarly
 or identically named function that behaves as our documentation indicates.

 Thanks,

 Mike Hearne

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1123#comment:18>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list