[SciPy-user] python crash in leastsq

Travis Oliphant oliphant.travis at ieee.org
Thu Sep 28 14:05:18 EDT 2006


djf at 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?
>   

Please give a more detailed report.  What versions of scipy and numpy 
are you using?   And if you can provide a trace-back that is even better.

-Travis




More information about the SciPy-User mailing list