[Numpy-discussion] iterating over an array  Chris Barker
Chris.Barker at noaa.gov Fri Jan 14 11:54:26 CST 2005  Francesc
Altet wrote: > That shows that numarray indexing is slower than
Numeric, but not by a large > extent (just a 40%). The real
problem with numarray (for Ralf's example) is, > as is already
known, array creation time.  Thanks for clearing this up. The
case I care about(at the moment) is in  wxPython's
"PointListHelper". It converts whatever Python sequence you
give it into a wxList of wxPoints. The sequence you give it
needs to  look something like a list of (x,y) tuples. An NX2
Numeric or Numarray  array works just fine, but both are slower
than a list of tuples, and  Numarray is MUCH slower. This
appears to be exactly analogous the OP's  example, of extracting
a bunch of (2,) arrays from the (N,2) array. Then  the two
numbers must be extracted from the (2,) array, and then
converted to a wxPoint. It seems the creation of all those (2,)
numarrays is what's taking the time.  A) Is there wor