[SciPy-user] python crash in leastsq

djf at pdx.edu djf at pdx.edu
Thu Sep 28 12:37:32 CDT 2006



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?

thanks,
djoefish



More information about the SciPy-user mailing list