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

Closed
argriffing opened this Issue Feb 27, 2014 · 2 comments

3 participants

@argriffing

http://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.linkage.html

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:
http://www.mathworks.com/help/stats/linkage.html

@WarrenWeckesser

Duplicate? See #2614

@rgommers
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