[Tutor] SciPy Optimize-like calling function as string

Alan Gauld alan.gauld at yahoo.co.uk
Sat Feb 18 18:21:10 EST 2017


On 18/02/17 21:52, Joseph Slater wrote:
> I'm trying to use the scipy.optimize code ...
> I've seen this done with dictionaries on some pages, 
> but it seems that this is intended to be faster

There is a saying in programming that premature
optimization is the root of all evil.

If you don't know that you need to optimize then your
time is usually better spent elsewhere. Dictionaries
are pretty fast in Python and I'd suggest you try
that first before shaving milliseconds in places
that may not be where you need to make savings.

Identify an actual problem, then identify the cause
and optimise that. Don't try to second guess the future.
Most performance problems are down to bad algorithms
or bad data structures not bad dispatch techniques.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list