to_pandas

LeafTree.to_pandas()

Return a pandas dataframe of the leaf tree.

Each row represents a segment in the condensed tree, with the first row representing the phantom root.

The parent column indicates the parent cluster ID for each segment. These IDs start from 0 and are row-indices into the leaf tree. The phantom root has itself as a parent to indicate that it is the root of the tree.

The min_distance and max_distance columns form a right-open [birth, death) interval, indicating at which distance thresholds clusters exist.

The min_size and max_size columns form a left-open (birth, death] interval, indicating at which min cluster size thresholds clusters are leaves. If max_size <= min_size, the cluster is not a leaf.