I have n 3-dimensional vectors. Is there a way to find distance between all using euclidean distance?


1 Answer 1


You can use sklearn's euclidean_distances function.


In [1]: from sklearn.metrics.pairwise import euclidean_distances

In [2]: import numpy as np

In [3]: x = np.random.rand(10, 3)

In [4]: euclidean_distances(x)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.