[SciPy-User] How to fix a parameter when using curve_fit ?

josef.pktd at gmail.com josef.pktd at gmail.com
Fri Jun 10 08:35:27 EDT 2011


On Fri, Jun 10, 2011 at 8:01 AM, Spark Liang <sparkliang at gmail.com> wrote:
> Hi, would someone be so kind to tell me how to fix some parameters when
> using curve_fit ?
> I googled it and found that I may use scipy.odr or mpfit, but they seem
> rather complicated.
> I also searched the maillist, someone said it can be done by by writing a
> nested function or a class. but how to do it?

a full version is at http://docs.python.org/library/functools.html in
the example for functools.partial

I usually prefer to use a class, where you set the fixed parameters in
the __init__ and access it with self.a(ttributename) inside the
function.

Josef

>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>



More information about the SciPy-User mailing list