scipy.cluster.hierarchy.linkage docstring is confusing #3401

argriffing opened this Issue Feb 27, 2014 · 2 comments

3 participants


The first couple of paragraphs say that y must be a condensed distance matrix, but the Parameters section says that y is optionally a data array. In practice the function does different things depending on the shape of y: if it appears 1d then it is treated as a condensed distance matrix, otherwise if it is 2d then it is treated as a data matrix (not as a compressed or uncompressed distance matrix). If it is not 1d or 2d then it falls off the if/elif and tries to return something that doesn't exist.

Here's the MATLAB function that hierarchy.linkage appears to try to clone:


Duplicate? See #2614

SciPy member

closing as duplicate

@rgommers rgommers closed this May 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment