Loopless syntax for 2d in NumPy (or Numarray)

Terry Reedy tjreedy at udel.edu
Wed Oct 22 18:36:19 EDT 2003


"2mc" <mcrider at bigfoot.com> wrote in message
news:500a4565.0310211950.519f3d00 at posting.google.com...
> 1. Would a psyco-ized normal Python program that performs
calculations
> be slower, faster, or as fast as the equivalent in NumPy?

This is not an either/or choice.  Psyco is best used on a few
bottlenect functions.  (Currently, it greatly expands the size of what
is works on.)  If you did a running max with heaps, that would be a
candidate.  Large array calcs done in NumPy as it is meant to be used
should be fastest.

If speed is a problem, also look at Weave as Fernando suggested.  That
might be alternative for all or part of running max.

For spicific answers for your problem on your system, you will have to
test time yourself.  New time_it make simple stuff pretty easy.  We
have given you about as much general answer as is possible.

> 2. Can Numerical Python be psyco-ized?  I'm supposing it cannot.

Correct, only the Python code calling it, but there would be little
point to that probably.

Terry J. Reedy






More information about the Python-list mailing list