TreeNode.
find_by_id
(node_id)[source]¶Find a node by id.
State: Experimental as of 0.4.0.
This search method is based from the root.
node_id (int) – The id of a node in the tree
The tree node with the matcing id
Notes
This method does not cache id associations. A full traversal of the tree is performed to find a node by an id on every call.
MissingNodeError – This method will raise if the id cannot be found
See also
Examples
>>> from skbio import TreeNode
>>> tree = TreeNode.read(["((a,b)c,(d,e)f);"])
>>> print(tree.find_by_id(2).name)
d