skbio.tree.TreeNode.remove_deleted¶

TreeNode.remove_deleted(func)[source]

Delete nodes in which func(node) evaluates True.

State: Experimental as of 0.4.0.

Remove all descendants from self that evaluate True from func. This has the potential to drop clades.

Parameters

func (a function) – A function that evaluates True when a node should be deleted

>>> from skbio import TreeNode