finding euclidean distance,better code?
gagsl-py2 at yahoo.com.ar
Sat Mar 29 00:18:46 CET 2008
En Fri, 28 Mar 2008 18:15:04 -0300, harryos <oswald.harry at gmail.com>
> if i were to calculate the euclidean distance in the above example how
> should i go about it..?
> should i replace
> distance = abs(input_wk - weights[image, :])
> with something else?
For a single 2D vector, math.hypot does what you want. But the above looks
like a NumPy array; see this thread
More information about the Python-list