On Wed, May 2, 2012 at 11:06 AM, Moroney, Catherine M (388D) <[email protected]> wrote: > I will want to compare a 7-element vector (called "element") to a large list > of similarly-dimensioned > vectors (called "target", and pick out the vector in "target" that is the > closest to "element" > (determined by minimizing the Euclidean distance).
It's not entirely clear what you mean from the description above. In the code example, you return a single index, but from the description it sounds like you want to pick out a vector? If you need multiple answers, one for each element, then you probably need to do broadcasting as shown in the NumPy medkit: http://mentat.za.net/numpy/numpy_advanced_slides/ Stéfan _______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
