Skip to main content
`Ctrl`+`K`

# skbio.tree.TreeNode.append

TreeNode.append(node)

  Add a node to self’s children.

  Parameters:
    node TreeNode

      Node to add as a child.

  See also

  `extend`

  Notes

  `append` will invalidate any node lookup caches, remove the node’s parent if it exists, set the parent of node to self, and add the node to self’s children.

  Examples

      >>> from skbio import TreeNode
      >>> root = TreeNode(name="root")
      >>> child1 = TreeNode(name="child1")
      >>> child2 = TreeNode(name="child2")
      >>> root.append(child1)
      >>> root.append(child2)
      >>> print(root)
      (child1,child2)root;