curve_fit in scipy

Sharan Basappa sharan.basappa at gmail.com
Tue Jun 19 23:01:54 EDT 2018


> > Secondly, I don't understand how curve_fit knows the number of arguments that test_func takes.
> 
> Part of the dynamic nature of Python is that a function carries with it 
> the number of parameters (as just one among many such properties).  We 
> call it "introspection" when we examine such properties of objects.  The 
> curve_fit function usees such an introspection to find that 
> test_function has two parameters (a and b) defining the family of curves.

Thanks a lot. The above feature where a given function is able to inspect another function is really cool. This gives me an idea to go a read it further. 




More information about the Python-list mailing list