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

NumPy Trac numpy-tickets@scipy....
Tue Jan 18 09:02:08 CST 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 ged):

 Replying to [comment:14 markhmoulton@…]:
 > It is a mistake to define a sum of NaNs to equal zero.

 This is the "nansum" function we are talking about, not the normal "sum"
 function, which of course returns nan if there is any nan value in the
 array.

 nansum is *designed* to treat nan like 0, which is sometimes exactly what
 you need. This is not your case, but nobody forces you to use that
 function. We are not even discussing the general behavior of nansum, but a
 few corner cases of it.

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


More information about the NumPy-Tickets mailing list