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