[SciPy-user] python crash in leastsq

djf at pdx.edu djf at pdx.edu
Thu Sep 28 13:37:32 EDT 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