Find all nodes given a function
This search method is based on the current subtree, not the root.
Parameters: | func : a function
|
---|---|
Returns: | GeneratorType
|
See also
Examples
>>> from skbio.core.tree import TreeNode
>>> tree = TreeNode.from_newick("((a,b)c,(d,e)f);")
>>> func = lambda x: x.parent == tree.find('c')
>>> [n.name for n in tree.find_by_func(func)]
['a', 'b']