Skip to content

Instantly share code, notes, and snippets.

@jmborr
Created June 14, 2020 22:01
Show Gist options
  • Save jmborr/bfa24a16c3904d9d2dc52b4565f80e56 to your computer and use it in GitHub Desktop.
Save jmborr/bfa24a16c3904d9d2dc52b4565f80e56 to your computer and use it in GitHub Desktop.
cluster 1000 3D points by euclidean distance
from scipy.cluster.hierarchy import fclusterdata
import numpy as np
import time
x = np.random.random((1000, 3))
start_time = time.time()
fclusterdata(x, 0.001, criterion='distance', metric='euclidean', method='complete')
print('elapsed time =', time.time() - start_time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment