1

Say I got two lists of vectors:

l1 = [v1, v2, v3]
l2 = [v4, v5, v6]

I know that with scipy I can get pairwise distances within a list but how do I do it for two so that the results look like that:

[[d(v1, v4), d(v1, v5), d(v1,v6)],
 [d(v2, v4), d(v2, v5), d(v2, v6)],
 [d(v3, v4), d(v3, v4), d(v3, v4)]]

in the most efficient way possible? loops are best to be avoided.

Mario
  • 561
  • 3
  • 18

0 Answers0