Skip to main content
`Ctrl`+`K`

# skbio.tree.TreeNode.pop

TreeNode.pop(index=-1)

  Remove and return a child node by its index position from self.

  Parameters:
    index int

      The index position in `children` to pop.

  Returns:
    TreeNode

      The popped child node.

  See also

  `remove`
  `remove_deleted`

  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;