Find all nodes that match name
The first call to find_all will cache all nodes in the tree on the assumption that additional calls to find_all will be made.
Parameters: | name : TreeNode or str
|
---|---|
Returns: | list of TreeNode
|
Raises: | MissingNodeError
|
See also
Examples
>>> from six import StringIO
>>> from skbio.tree import TreeNode
>>> tree = TreeNode.read(StringIO("((a,b)c,(d,e)d,(f,g)c);"))
>>> for node in tree.find_all('c'):
... print(node.name, node.children[0].name, node.children[1].name)
c a b
c f g
>>> for node in tree.find_all('d'):
... print(node.name, str(node))
d (d,e)d;
d d;