Skip to content

Instantly share code, notes, and snippets.

@Guidosalimbeni
Created January 7, 2021 21:22
Show Gist options
  • Save Guidosalimbeni/ddbea8b144bcf87867e97a57ef614faa to your computer and use it in GitHub Desktop.
Save Guidosalimbeni/ddbea8b144bcf87867e97a57ef614faa to your computer and use it in GitHub Desktop.
def euclideanDistance(instance1, instance2, length):
distance = 0
for x in range(length):
distance += pow((float(instance1[x]) - float(instance2[x])), 2)
return math.sqrt(distance)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment