[Scipy-tickets] [SciPy] #1291: stats.discrete distributions hypergeom.sf exception

SciPy Trac scipy-tickets@scipy....
Wed Sep 29 21:30:42 CDT 2010


#1291: stats.discrete distributions hypergeom.sf exception
-------------------------+--------------------------------------------------
 Reporter:  josefpktd    |       Owner:  somebody
     Type:  defect       |      Status:  new     
 Priority:  normal       |   Milestone:  0.9.0   
Component:  scipy.stats  |     Version:  0.7.0   
 Keywords:               |  
-------------------------+--------------------------------------------------
 hypergeom.sf raises an exception when it is run at the first time with
 only arguments that are outside of the support of the distribution. After
 doing some other calls to hypergeom, the original failing call works.

 {{{
 >>> from scipy.stats import hypergeom
 >>> hypergeom.sf(5,10,2,5)

 Traceback (most recent call last):
   File "<pyshell#20>", line 1, in <module>
     hypergeom.sf(5,10,2,5)
   File "C:\...\scipy-0.9.0.dev6579.win32\Programs\Python25\Lib\site-
 packages\scipy\stats\distributions.py", line 5098, in sf
     place(output,cond,self._sf(*goodargs))
   File "C:\...\scipy-0.9.0.dev6579.win32\Programs\Python25\Lib\site-
 packages\scipy\stats\distributions.py", line 4868, in _sf
     return 1.0-self._cdf(x,*args)
   File "C:\...\scipy-0.9.0.dev6579.win32\Programs\Python25\Lib\site-
 packages\scipy\stats\distributions.py", line 4862, in _cdf
     return self._cdfvec(k,*args)
   File "C:\Programs\Python25\lib\site-
 packages\numpy\lib\function_base.py", line 1803, in __call__
     newargs.append(asarray(arg).flat[0])
 IndexError: invalid index
 }}}

 reported at
 http://stackoverflow.com/questions/3812896/can-some-explain-this-strange-
 behavior-of-the-hypergeometric-distribution-in-scip

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


More information about the Scipy-tickets mailing list