skbio.tree.TreeNode.remove#
- TreeNode.remove(node, uncache=True)[source]#
Remove a child node by identity from self.
- Parameters:
- Returns:
- bool
True if the node was removed. False if the node is not a child of self.
See also
Notes
The parent of the removed node will be set to None. The removed node and its children (if any) still exist, but are disconnected from the tree. Therefore, this method is useful for detaching a clade from a tree.
Examples
>>> from skbio import TreeNode >>> tree = TreeNode.read(["(a,b)c;"]) >>> tree.remove(tree.children[0]) True