class documentation
Represents a dendrogram, a tree with a specified branching order. This must be initialised with the leaf items, then iteratively call merge for each branch. This class constructs a tree representing the order of calls to the merge function.
Method | __init__ |
No summary |
Method | __repr__ |
Undocumented |
Method | groups |
Finds the n-groups of items (leaves) reachable from a cut at depth n. :param n: number of groups :type n: int |
Method | merge |
Merges nodes at given indices in the dendrogram. The nodes will be combined which then replaces the first node specified. All other nodes involved in the merge will be removed. |
Method | show |
Print the dendrogram in ASCII art to standard out. :param leaf_labels: an optional list of strings to use for labeling the |
Instance Variable | _items |
Undocumented |
Instance Variable | _merge |
Undocumented |
Instance Variable | _original |
Undocumented |
Finds the n-groups of items (leaves) reachable from a cut at depth n. :param n: number of groups :type n: int
Merges nodes at given indices in the dendrogram. The nodes will be combined which then replaces the first node specified. All other nodes involved in the merge will be removed.
Parameters | |
*indices:seq of int | indices of the items to merge (at least two) |