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

skbio.tree.TreeNode.extend#

TreeNode.extend(nodes)[source]#

Append a list of TreeNode to self.

extend will invalidate any node lookup caches, remove existing parents of the nodes if they have any, set their parents to self and add the nodes to self children.

Parameters:
nodeslist of TreeNode

A list of TreeNode objects

See also

append

Examples

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