Skip to main content
`Ctrl`+`K`

# skbio.tree.TreeNode.count

TreeNode.count(tips=False)

  Get the count of nodes in the tree.

  Parameters:
    tips bool

      If `True`, only return the count of tips.

  Returns:
    int

      The number of nodes.

  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