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.
Parameters: | node_id : int
|
---|---|
Returns: | TreeNode
|
Raises: | MissingNodeError
|
See also
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.
Examples
>>> from skbio import TreeNode
>>> tree = TreeNode.read(["((a,b)c,(d,e)f);"])
>>> print(tree.find_by_id(2).name)
d