skbio.tree.BPTree.tip_positions#

BPTree.tip_positions()[source]#

Positions of the tips, in tree order.

Returns:
numpy.ndarray of intp

The opening parenthesis of each tip, in the order the tips appear in the tree (left to right).

See also

positions
is_tip

Examples

>>> from skbio.tree import BPTree
>>> tree = BPTree.read(["((a:1,b:2)c:3,(d:4,e:5)f:6)root;"])
>>> tree.tip_positions()
array([ 2,  4,  8, 10])
>>> [tree.name(i) for i in tree.tip_positions()]
['a', 'b', 'd', 'e']