title: Efficient and precise calculation of the euclidean distance
body: <p>Following some online research (<a href="https://stackoverflow.com/a/1401828/6182051">1</a>, <a href="http://www.codehamster.com/2015/03/09/different-ways-to-calculate-the-euclidean-distance-in-python/" rel="noreferrer">2</a>, <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.norm.html" rel="noreferrer">numpy</a>, <a href="http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.spatial.distance.euclidean.html" rel="noreferrer">scipy</a>, <a href="http://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise.euclidean_distances.html" rel="noreferrer">scikit</a>, <a href="https://docs.python.org/3/library/math.html#math.hypot" rel="noreferrer">math</a>), I have found several ways for calculating the <strong>Euclidean Distance in Python</strong>: </p>
  
  <pre><code># 1
  numpy.linalg.norm(a-b)
  
  # 2
  distance.euclidean(vector1, vector2)
  
  # 3
  sklearn.metrics.pairwise.euclidean_distances  
  
  # 4
  sqrt((xa-xb)^2 + (ya-yb)^2 + (za-zb)^2)
  
  # 5
  dist = [(a - b)**2 for a, b in zip(vector1, vector2)]
  dist = math.sqrt(sum(dist))
  
  # 6
  math.hypot(x, y)
  </code></pre>
  
  <p>I was wondering if someone could provide an insight on which of the above (<em>or any other that I have not found</em>) is considered the best in terms of <strong>efficiency</strong> and <strong>precision</strong>. If someone is aware of any <em>resource(s)</em> which discusses the subject that would also be great.</p>
  
  <p>The <em>context</em> I am interesting in is in calculating the Euclidean Distance between pairs of number-tuples, e.g. the distance between <code>(52, 106, 35, 12)</code> and <code>(33, 153, 75, 10)</code>.</p>