Obtenez la distance entre les points dans 1 tableau Pythoin
dist = np.abs(pts[np.newaxis, :, :] - pts[:, np.newaxis, :]).min(axis=2)
Funny Fox
dist = np.abs(pts[np.newaxis, :, :] - pts[:, np.newaxis, :]).min(axis=2)
# Python Program to explain math.dist() method
# Importing math module
import math
# One dimensional Point
# Coordinate of Point P
P = 3
# Coordinates of point Q
Q = -8
# Calculate the Euclidean distance
# between points P and Q
eDistance = math.dist([P], [Q])
print(eDistance)