[Scipy-tickets] [SciPy] #1167: gaussian_kde crashes with ValueError if single-element input is given

SciPy Trac scipy-tickets@scipy....
Sun Apr 25 12:45:22 CDT 2010


#1167: gaussian_kde crashes with ValueError if single-element input is given
-----------------------+----------------------------------------------------
 Reporter:  dktrkranz  |       Owner:  somebody
     Type:  defect     |      Status:  new     
 Priority:  normal     |   Milestone:  0.7.2   
Component:  Other      |     Version:  0.7.0   
 Keywords:             |  
-----------------------+----------------------------------------------------
 Forwarded from http://bugs.debian.org/569008

 The following command
 {{{
 python -c 'from scipy.stats.kde import gaussian_kde; gaussian_kde([1])
 }}}

 generates this traceback:
 {{{
 Traceback (most recent call last):
   File "<string>", line 1, in <module>
   File "/usr/lib/python2.5/site-packages/scipy/stats/kde.py", line 81, in
 __init__
     self._compute_covariance()
   File "/usr/lib/python2.5/site-packages/scipy/stats/kde.py", line 334, in
 _compute_covariance
     self.inv_cov = linalg.inv(self.covariance)
   File "/usr/lib/python2.5/site-packages/scipy/linalg/basic.py", line 342,
 in inv
     a1 = asarray_chkfinite(a)
   File "/usr/lib/python2.5/site-packages/numpy/lib/function_base.py", line
 705, in asarray_chkfinite
     raise ValueError, "array must not contain infs or NaNs"
 ValueError: array must not contain infs or NaNs
 }}}

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


More information about the Scipy-tickets mailing list