Skip to main content
`Ctrl`+`K`

# skbio.tree.TreeNode.neighbors

TreeNode.neighbors(ignore=None)

  Return all nodes that are connected to self.

  This call does not include self in the result

  Parameters:
    ignore TreeNode

      A node to ignore

  Returns:
    list of TreeNode

      The list of all nodes that are connected to self

  Examples

      >>> from skbio import TreeNode
      >>> tree = TreeNode.read(["((a,b)c,(d,e)f)root;"])
      >>> node_c = tree.find('c')
      >>> [n.name for n in node_c.neighbors()]
      ['a', 'b', 'root']