【发布时间】:2020-07-08 14:38:56
【问题描述】:
假设我有两个点数组,我想知道每个点之间的距离是多少。
例如:
array_1 = [p1,p2,p3,p4]
array_2 = [p5,p6]
p1 到 p6 是点,类似于 [1,1,1] (3D)
我想要的输出是
output = [[distance of p1 to p5, distance of p2 to p5, ... distance of p4 to p5],
[distance of p1 to p6, distance of p2 to p6, ... distance of p4 to p6]]
如果我想使用 numpy,最好的方法是什么?
【问题讨论】:
标签: python-3.x numpy euclidean-distance