Simple agglomerative hierarchical clustering in Python