skbio.tree.BPTree.level_ancestor#
- BPTree.level_ancestor(i, d)[source]#
Index of the ancestor a given number of levels above a node.
- Parameters:
- iint
Index of the node to evaluate.
- dint
Number of levels to ascend toward the root.
- Returns:
- int
Index of the ancestor
dlevels above nodei, or -1 ifdis not positive.
See also
Notes
Returns an integer index into the parentheses bit array, not a node object.
ancestorsreturns the full list of ancestor nodes from a node toward the root.