skbio.tree.BPTree.previous_sibling#

BPTree.previous_sibling(i)[source]#

Index of the previous (left) sibling of a node.

Parameters:
iint

Index of the node to evaluate.

Returns:
int

Index of the previous sibling of node i, or 0 if i has no previous sibling (0 is the root, which can never be a sibling).

Notes

Returns the integer index of a single sibling, unlike siblings, which returns a list of all sibling nodes.