from scipy.spatial.distance import cdist city_coordinate = [(314, 212), (339, 135), (177, 224), (312, 139), (348, 153), (326, 156), (328, 129), (196, 144), (412, 790), (438, 570), (307, 170), (256, 176), (278, 149), (238, 676)] distances = cdist(city_coordinate, city_coordinate, 'euclidean'), print(distances)
06-10
5414