28 Sep
2006
28 Sep
'06
11:09 a.m.
On Thu, Sep 28, 2006 at 10:37:32AM -0700, djf@pdx.edu wrote:
I receive a segmentation fault from the following code:
from scipy.optimize import * from scipy import * # Fit Mean of A*x to Mean of B---------- #-------------------------------------- def fit(x): d=mean(x*A)-mean(B) return d #-------------------------------------- A=[1,2] B=[3,4] x0=[1] (x,msg)=leastsq(fit,x0) print x
Any advice?
I don't see any memory errors running your code with numpy 1.0.dev3230 scipy 0.5.2.dev2235 It produces the correct answer, 2.3333333. Which versions of numpy and scipy are you running, and on which platform? Regards Stéfan