[Tutor] Fwd: Re: SciPy Optimize-like calling function as string

Alan Gauld alan.gauld at yahoo.co.uk
Sat Feb 25 12:24:44 EST 2017


Forwarding to list.

Please always use reply-All or Reply-list when responding to the list.

On Feb 18, 2017, at 6:21 PM, Alan Gauld via Tutor <tutor at python.org
<mailto:tutor at python.org>> wrote:
>
> 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.

This is true, but I'm conceding that I don't need the solution so much
as I'm trying to polish my Python. In fact, there is no problem I'm
solving today. This is mostly a training exercise. I'd like to be as
"pythonic" as possible in the long run.

>
> 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.

Honestly, that method makes no sense to me whatsoever. 

>
> 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.

(I will go Google "dispatch techniques"). 

I'm trying to overcome 20 years of "Matlab" programming to modernize.
I've fallen way out of touch and taken this up as a hobby that may also
be professionally helpful from time to time. 

Sorry for the delay. I really do appreciate the responses. It's my hobby
versus my day job now. My students get all the fun of actually
programing these days!


Professor & Chair
~~~~~~~~~~~~~~~~~~~~~~~~
(+1) 937-775-5040
https://people.wright.edu/joseph.slater



More information about the Tutor mailing list