Do not use global random number generator
Replace squareform(pdist(*, "sqeuclidean"))

... by sklearn.metrics.pairwise.euclidean_distances