[Numpy-discussion] record arrays initialization

Kevin Jacobs <jacobs@bioinformed.com> bioinformed at gmail.com
Wed May 2 18:27:20 EDT 2012


On Wed, May 2, 2012 at 5:45 PM, Moroney, Catherine M (388D) <
Catherine.M.Moroney at jpl.nasa.gov> wrote:

> Thanks to Perry for some very useful off-list conversation.   I realize
> that
> I wasn't being clear at all in my earlier description of the problem so
> here it is
> in a nutshell:
>
> Find the best match in an array t(5000, 7) for a single vector e(7).  Now
> scale
> it up so e is (128, 512, 7) and I want to return a (128, 512) array of the
> t-identifiers
> that are the best match for e.  "Best match" is defined as the minimum
> Euclidean distance.
>
>
It sounds like you want to find the nearest neighbor to a point in a
high-dimensional space. This sounds like a job for a spacial data structure
like a KD-tree.  See:

http://docs.scipy.org/doc/scipy/reference/spatial.html
http://mloss.org/software/view/143/
http://www.mrzv.org/software/pyANN/
etc.

-Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20120502/b056520f/attachment.html>


More information about the NumPy-Discussion mailing list