import numpy as np from scipy.cluster.hierarchy import fcluster, linkage labels = np.array( [ "web-1", "web-2", "web-3", "cache-1", "cache-2", "cache-3", "db-1", "db-2", "db-3", ] ) observations = np.array( [ [0.0, 0.1], [0.2, -0.1], [-0.2, 0.0], [0.1, 4.8], [-0.1, 5.1], [0.3, 5.0], [5.1, 4.9], [4.8, 5.2], [5.0, 5.1], ] )