[Numpy-discussion] speed of numpy.ndarray compared to Numeric.array

David Cournapeau cournape at gmail.com
Mon Jan 10 03:53:01 EST 2011


On Mon, Jan 10, 2011 at 5:09 PM, EMMEL Thomas <Thomas.EMMEL at 3ds.com> wrote:
> To John:
>
>> Did you try larger arrays/tuples? I would guess that makes a significant
>> difference.
>
> No I didn't, due to the fact that these values are coordinates in 3D (x,y,z).
> In fact I work with a list/array/tuple of arrays with 100000 to 1M of elements or more.
> What I need to do is to calculate the distance of each of these elements (coordinates)
> to a given coordinate and filter for the nearest.

Note that for this exact problem, there are much better methods than
brute force (O(N^2) for N vectors), through e.g. kd-trees, which work
very well in low-dimension. This will matter much more than numeric vs
numpy

cheers,

David



More information about the NumPy-Discussion mailing list