Skip to content

Instantly share code, notes, and snippets.

@nchibana
Last active October 17, 2019 23:21
Show Gist options
  • Select an option

  • Save nchibana/d83461a51d889ca7d25d5ac5cd2f63a5 to your computer and use it in GitHub Desktop.

Select an option

Save nchibana/d83461a51d889ca7d25d5ac5cd2f63a5 to your computer and use it in GitHub Desktop.
hierarchical clustering
from scipy.cluster.hierarchy import fcluster
import scipy.cluster.hierarchy as hac
Z = hac.linkage(df_interpolate.iloc[:,0:266], method='ward', metric='euclidean')
# k Number of clusters I'd like to extract
results = fcluster(Z, k, criterion='maxclust')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment