[Numpy-tickets] [NumPy] #440: Inconsistent behaviour for empty arrays

NumPy numpy-tickets@scipy....
Sat May 3 16:51:19 CDT 2008


#440: Inconsistent behaviour for empty arrays
--------------------+-------------------------------------------------------
 Reporter:  stefan  |        Owner:  stefan
     Type:  defect  |       Status:  new   
 Priority:  normal  |    Milestone:  1.2.0 
Component:  Other   |      Version:        
 Severity:  normal  |   Resolution:        
 Keywords:          |  
--------------------+-------------------------------------------------------
Comment (by alan.mcintyre):

 As of today, mean([]), average([]), and median([]) all return nan.

 The docstring for average says that ZeroDivisionError is only raised if
 "all weights along axis are zero" (although from the code it appears that
 it should say "the sum of weights along an axis is zero").

 Is returning a nan the intended behavior, and is it worth the space in the
 docstrings to document the behavior for an empty list (or is that best
 documented elsewhere)?

-- 
Ticket URL: <http://scipy.org/scipy/numpy/ticket/440#comment:3>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list