skbio.tree.TreeNode.pop#
- TreeNode.pop(index=-1)[source]#
Remove and return a child node by its index position from self.
- Parameters:
- indexint
The index position in
children
to pop.
- Returns:
- TreeNode
The popped child node.
See also
Notes
All node lookup caches are invalidated, and the parent reference for the popped node will be set to
None
.Examples
>>> from skbio import TreeNode >>> tree = TreeNode.read(["(a,b)c;"]) >>> print(tree.pop(0)) a;