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

NumPy Trac numpy-tickets@scipy....
Wed Apr 28 15:04:15 CDT 2010


#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 warren.weckesser):

 I agree with mhearne and others who say that nansum() should return 0 when
 given an array of all nans.  One can interpret a nan in the array as
 equivalent to 0, or as a value to be ignored.  Then an array of all nans
 is either the same as an array of all zeros, or an empty array.  In either
 case, the most consistent behavior is to return 0 (the latter case being
 consistent with numpy.sum([]) and with Python's sum([])).

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


More information about the NumPy-Tickets mailing list