Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


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

argriffing opened this Issue · 2 comments

3 participants

argriffing Warren Weckesser Ralf Gommers

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:

Warren Weckesser

Duplicate? See #2614

Ralf Gommers

closing as duplicate

Ralf Gommers rgommers closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.