[Scipy-tickets] [SciPy] #1688: binomial (in numpy.random) and scipy.stats.binom are not defined for n=0

SciPy Trac scipy-tickets@scipy....
Thu Jul 5 09:44:04 CDT 2012


#1688: binomial (in numpy.random) and scipy.stats.binom are not defined for n=0
-------------------------+--------------------------------------------------
 Reporter:  jokahn       |       Owner:  somebody   
     Type:  defect       |      Status:  new        
 Priority:  normal       |   Milestone:  Unscheduled
Component:  scipy.stats  |     Version:  0.10.0     
 Keywords:               |  
-------------------------+--------------------------------------------------
 binomial and scipy.stats.binom are not defined for n=0, raising a value
 error.
 For example
 [[BR]]
 {{{binomial(0, .3)}}}
 [[BR]]
 or
 [[BR]]
 {{{scipy.stats.binom.rvs(arange(5),.3)}}}
 [[BR]]
 will fail.

 The binomial distribution is perfectly well-defined in this case: it is
 merely the Dirac at zero. Therefore a function implementing this random
 variable should not fail in this case.

 Add to that the fact that a typical use of the function would be thinning
 data on many entries, where some might be zero, and it's also a practical
 concern.

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1688>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list