[SciPy-user] Undefined variable bug in scipy.stats.gaussian_kde.integrate_1d

John Reid j.reid@mail.cryst.bbk.ac...
Wed Nov 7 10:03:06 CST 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