From numpy import linalg as LA. The simplest thing you can do is call the distance_matrix function in the SciPy spatial package. Please log in or register to add a comment.
Import numpy as np.
For miles multiply by 3798. The associated norm is called the Euclidean norm. If p p1 p2 and q q1 q2 then the distance is given by. A 1 2 3 b 4 5 6 dist numpylinalgnorm a-b If you want to learn Python visit this P ython tutorial and Python course.