Fork me on GitHub"

# skbio.tree.TreeNode.find

`TreeNode.``find`(name)

  Find a node by name.

  State: Experimental as of 0.4.0.

  The first call to find will cache all nodes in the tree on the assumption that additional calls to find will be made.

  find will first attempt to find the node in the tips. If it cannot find a corresponding tip, then it will search through the internal nodes of the tree. In practice, phylogenetic trees and other common trees in biology do not have unique internal node names. As a result, this find method will only return the first occurance of an internal node encountered on a postorder traversal of the tree.

  Parameters:

  name : TreeNode or str

  > The name or node to find. If name is TreeNode then it is simply returned

  Returns:

  TreeNode

  > The found node

  Raises:

  MissingNodeError

  > Raises if the node to be searched for is not found

  See also

  `find_all`, `find_by_id`, `find_by_func`

  Examples

      >>> from skbio import TreeNode
      >>> tree = TreeNode.read(["((a,b)c,(d,e)f);"])
      >>> print(tree.find('c').name)
      c