I have many data points that are clustered as follows using Scipy Hierarchical Clustering. Say I want to trim the dendrogram at the 1500 level? How to do it? (I tried using the "p" parameter, and that is not what I expect)
Z = dendrogram(linkage_matrix, truncate_mode='lastp', color_threshold=1, labels=df.session.tolist(), distance_sort='ascending') plt.title("Hierachical Clustering") plt.show()

python scipy hierarchical-clustering
Nilani algiriyage
source share