[SciPy-user] Undefined variable bug in scipy.stats.gaussian_kde.integrate_1d
John Reid
j.reid at mail.cryst.bbk.ac.uk
Wed Nov 7 11:03:06 EST 2007
I get the following error when calling scipy.stats.gaussian_kde.integrate_1d
c:\apps\python25\lib\site-packages\scipy\stats\kde.py in
integrate_box_1d(self, low, high)
204 raise ValueError("integrate_box_1d() only handles
1D pdfs")
205
--> 206 stdev = np.ravel(sqrt(self.covariance))[0]
207
208 normalized_low = ravel((low - self.dataset)/stdev)
<type 'exceptions.NameError'>: global name 'np' is not defined
>
c:\apps\python25\lib\site-packages\scipy\stats\kde.py(206)integrate_box_1d()
205
--> 206 stdev = np.ravel(sqrt(self.covariance))[0]
207
I had a quick look at the source and I think perhaps np should be numpy.
Also ravel is explicitly imported from numpy in the file.
John.
More information about the SciPy-User
mailing list