![](https://secure.gravatar.com/avatar/5a2b30a58d0290e52f19c180ec190c31.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/49df8cd4b1b6056c727778925f86147a.jpg?s=120&d=mm&r=g)
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?
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
![](https://secure.gravatar.com/avatar/5a2b30a58d0290e52f19c180ec190c31.jpg?s=120&d=mm&r=g)
OS: Ubuntu Dapper Drake Python info: Python 2.4, Scipy 0.3.2, Numpy 1.0b5 Output================================================= /usr/lib/python2.4/site-packages/scipy_base/ppimport.py:273: UserWarning: The pstats module is not available. Install the python2.4-profiler Debian package if you need it module = __import__(name,None,None,['*']) -2.0 -2.0 Segmentation fault ======================================================== ----- Original Message ----- From: "Travis Oliphant" <oliphant.travis@ieee.org> To: "SciPy Users List" <scipy-user@scipy.org> Sent: Thursday, September 28, 2006 11:05 AM Subject: Re: [SciPy-user] python crash in leastsq
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?
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
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
![](https://secure.gravatar.com/avatar/af6c39d6943bd4b0e1fde23161e7bb8c.jpg?s=120&d=mm&r=g)
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
participants (4)
-
Daniel Fish
-
djf@pdx.edu
-
Stefan van der Walt
-
Travis Oliphant