TreeNode.
accumulate_to_ancestor
(ancestor)[source]¶Return the sum of the distance between self and ancestor
State: Experimental as of 0.4.0.
Parameters: | ancestor (TreeNode) – The node of the ancestor to accumulate distance too |
---|---|
Returns: | The sum of lengths between self and ancestor |
Return type: | float |
Raises: |
|
See also
Examples
>>> from skbio import TreeNode
>>> tree = TreeNode.read(["((a:1,b:2)c:3,(d:4,e:5)f:6)root;"])
>>> root = tree
>>> tree.find('a').accumulate_to_ancestor(root)
4.0