[SciPy-user] NameError

Huang, Zhong Zhong.Huang at uth.tmc.edu
Mon Apr 10 18:21:28 CDT 2006


Quite right.
I tried 
plsq=leastsq(residuals,p0,(y_meas,x))
it works, too.

Thank you, Travis.



Zhong
-----Original Message-----
From: scipy-user-bounces at scipy.net on behalf of Travis Oliphant
Sent: Mon 4/10/2006 6:15 PM
To: SciPy Users List
Subject: Re: [SciPy-user] NameError
 
Huang, Zhong wrote:

>Hi, I am trying to use least-squares procedure 
>of scipy. I encountered NameError problem:
>
>from scipy.optimize import leastsq
>plsq=leastsq(residuals,p0,args(y_meas,x))
>
>NameError: name 'args' is not defined
>
>Could anybody help me out?
>  
>

I think you mean:

args = (y_meas, x)

i.e.

plsq=leastsq(residuals,p0,args=(y_meas,x))



-Travis

_______________________________________________
SciPy-user mailing list
SciPy-user at scipy.net
http://www.scipy.net/mailman/listinfo/scipy-user

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 2675 bytes
Desc: not available
Url : http://www.scipy.net/pipermail/scipy-user/attachments/20060410/f80e0a63/attachment.bin


More information about the SciPy-user mailing list