Python alternative for calculating pairwise distance between two sets of 2d points [duplicate]
问题 This question already has answers here : Efficient distance calculation between N points and a reference in numpy/scipy (6 answers) Minimum Euclidean distance between points in two different Numpy arrays, not within (5 answers) Closed 2 years ago . In Matlab there exists the pdist2 command. Given the matrix mx2 and the matrix nx2 , each row of matrices represents a 2d point. Now I want to create a mxn matrix such that (i,j) element represents the distance from i th point of mx2 matrix to j th