TreeNode.
count
(tips=False)[source]¶Get the count of nodes in the tree
State: Experimental as of 0.4.0.
tips (bool) – If True, only return the count of the number of tips
The number of nodes or tips
int
Examples
>>> from skbio import TreeNode
>>> tree = TreeNode.read(["((a,(b,c)d)e,(f,g)h)i;"])
>>> print(tree.count())
9
>>> print(tree.count(tips=True))
5