[Numpy-discussion] Fast function application on list of 2D points?

Eric LEBIGOT Eric.Lebigot@normalesup....
Mon Jan 12 08:21:21 CST 2009


Hello,

What is the fastest way of applying a function on a list of 2D points?  More 
specifically, I have a list of 2D points, and some do not meet some criteria 
and must be rejected.  Even more specifically, the filter only lets through 
points whose x coordinate satisfies some condition, _and_ whose y coordinates 
satisfies another condition (maybe is there room for optimization, here?).

Currently, I use

   points = numpy.apply_along_axis(filter, axis = 1, arr = points)

but this creates a bottleneck in my program (array arr may contains 1 million 
points, for instance).

Is there anything that could be faster?

Any suggestion would be much appreciated!

EOL



More information about the Numpy-discussion mailing list