Replace squareform(pdist(*, "sqeuclidean"))

... by sklearn.metrics.pairwise.euclidean_distances