[SciPy-user] Difficulties with gaussian_kde
David Huard
david.huard at gmail.com
Mon Dec 12 12:10:16 EST 2005
Hi,
I'm trying to use gaussian_kde but it returns an error. Here's the code
from scipy.stats import gaussian_kde, norm
x = norm.rvs(10,2,size = 100)
ckde = gaussian_kde(x)
ckde.evaluate(10.)
returning the message :
File "/usr/lib/python2.4/site-packages/scipy/stats/kde.py", line 91, in
evaluate
points = atleast_2d(points).astype(self.dataset.typecode())
AttributeError: 'scipy.ndarray' object has no attribute 'typecode'
when trying resample(size = 10), I get
File "mtrand.pyx", line 837, in mtrand.RandomState.multivariate_normal
AttributeError: 'module' object has no attribute
'singular_value_decomposition'
I'm using a version of scipy obtained from svn last week. Since I'm a newbie
to Python and Scipy, I have the nagging feeling that I am missing something
trivial here. Am I ?
Thanks,
David Huard
If I may suggest, I would add a first line in the docstring of
kde.pydescribing how to call gaussian_kde, something as
""" Uni/multi-variate kernel density estimation. gaussian_kde(dataset) ->
class object
the rest of the docstring is pretty straighforward but the first step is
taken for granted, and since it returned errors, I had serious doubts as to
how the class had to be called.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20051212/b0b85256/attachment.html>
More information about the SciPy-User
mailing list