I'm looking for a fast way to compute euclidean distance of all values in a array. The Result should be in a new array ordered ascending with the two used "partners" for calculation.
eg:
a = [[2,4,5],[3,2,1],[5,7,2]]
res = euclidean distance(a) ordered ascending with
format: [result, value A, value B]
(result is the eu.dist. between value A and value B in array a)
e.g: (not calculated)
res = [[4, 0, 1],[6, 0, 2], [9, 1, 2]]
thin i will calculate the eu.dist in this way
def euclidean(a, b):
dist = numpy.linalg.norm(a-b)
return dist