[Scipy-tickets] [SciPy] #1398: problem with numpy 0's in stats.poisson.rvs

SciPy Trac scipy-tickets@scipy....
Tue Mar 1 20:32:01 CST 2011


#1398: problem with numpy 0's in stats.poisson.rvs
----------------------+-----------------------------------------------------
 Reporter:  parejkoj  |       Owner:  somebody
     Type:  defect    |      Status:  new     
 Priority:  normal    |   Milestone:          
Component:  Other     |     Version:  0.8.0   
 Keywords:            |  
----------------------+-----------------------------------------------------
 (I'm using scipy 0.8.0, numpy 1.5.0 on OS X 10.6.6, with python 2.6.6)

 poisson.rvs seems to have a broken positive-definite test in
 distributions.py:511.  If it is passed a list or tuple with zeros it is
 fine, but if it is passed a numpy array with zeros or single 0, it fails.

 For example:

 {{{
 from scipy.stats import poisson
 #this works
 poisson.rvs([0.,0.])
 #this doesn't
 poisson.rvs(np.zeros(10))
 #neither does this
 poisson.rvs(0)
 }}}
 I don't know why this doesn't work, but this looks like a bug, since
 numpy.random.poisson works just fine with 0 for lam.

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


More information about the Scipy-tickets mailing list