sch.fcluster(L, 0.5 * d.max(), 'distance')
L = sch.linkage(d, method='single')
sch.fcluster(L, 0.5 * d.max(), 'distance')
How to get flat clustering corresponding to color clusters in the dendrogram created by scipy