skbio.tree.TreeNode.find_by_func¶

TreeNode.find_by_func(func)[source]

Find all nodes given a function

State: Experimental as of 0.4.0.

This search method is based on the current subtree, not the root.

Parameters

func (a function) – A function that accepts a TreeNode and returns True or False, where True indicates the node is to be yielded

Yields

TreeNode – Node found by func.

Examples

>>> from skbio import TreeNode