scikit-bio is back in active development! Check out our announcement of revitalization.

skbio.tree.TreeNode.remove#

TreeNode.remove(node)[source]#

Remove a node from self.

Remove a node from self by identity of the node.

Parameters:
nodeTreeNode

The node to remove from self’s children

Returns:
bool

True if the node was removed, False otherwise

See also

pop
remove_deleted

Examples

>>> from skbio import TreeNode
>>> tree = TreeNode.read(["(a,b)c;"])
>>> tree.remove(tree.children[0])
True