Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
def EuclideanDistance(x,y):
S = 0; #The sum of the squared differences of the elements
for key in x.keys():
S += math.pow(x[key]-y[key],2);
return math.sqrt(S); #The square root of the sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment