2 This module provides code for various distance measures.
5 euclidean Euclidean distance between two points
6 euclidean_py Pure Python implementation of euclidean.
12 warnings.warn("Bio.distance is deprecated. If you use this module, please notify the Biopython developers at biopython-dev@biopython.org", DeprecationWarning)
17 """euclidean(x, y) -> euclidean distance between x and y"""
19 raise ValueError("vectors must be same length")
20 #return sqrt(sum((x-y)**2))
21 # Optimization by John Corradi (JCorradi@msn.com)
23 return sqrt(dot(d, d))
25 def euclidean_py(x, y):
26 """euclidean_py(x, y) -> euclidean distance between x and y"""
27 # lightly modified from implementation by Thomas Sicheritz-Ponten.
28 # This works faster than the Numeric implementation on shorter
31 raise ValueError("vectors must be same length")
33 for i in range(len(x)):