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

Robert Kern robert.kern@gmail....
Wed Nov 7 12:04:05 CST 2007


John Reid wrote:
> 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.

When reporting errors, please state the version which you are using. In this
case, the errors have already been fixed in SVN.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


More information about the SciPy-user mailing list