Nadav Horesh wrote:
> def distance(v1,v2):
>return sqrt(((v2-v1)**2).sum())
note that Roberts version didn't compute the sqrt, as to find the
minimum distance, you can just used the squared value.
If you do want the actual distance, then you might want to use
numpy.hypot, something like (un
: numpy-discussion@scipy.org
נושא: [Numpy-discussion] finding minimum distance using arrays
hi
i wrote a function to find euclidian distance between two vectors and
applied it to the rows of a 2d array of floats as below
from math import sqrt
from numpy import array,sum
def distance(vec1, vec2
On Wed, Apr 23, 2008 at 1:00 AM, wilson <[EMAIL PROTECTED]> wrote:
> hi
> i wrote a function to find euclidian distance between two vectors and
> applied it to the rows of a 2d array of floats as below
>
>
> from math import sqrt
> from numpy import array,sum
>
> def distance(vec1, vec2):
>
hi
i wrote a function to find euclidian distance between two vectors and
applied it to the rows of a 2d array of floats as below
from math import sqrt
from numpy import array,sum
def distance(vec1, vec2):
return sqrt(sum([(x-y)**2 for x,y in zip(vec1, vec2)]))
def findmatch(wts,inputwt):