1from scipy.cluster.hierarchy import dendrogram, linkage
2from matplotlib import pyplot as plt
3
4linked = linkage(X, 'single')
5
6labelList = range(1, 11)
7
8plt.figure(figsize=(10, 7))
9dendrogram(linked,
10 orientation='top',
11 labels=labelList,
12 distance_sort='descending',
13 show_leaf_counts=True)
14plt.show()
15