phylo2vec.from_pairs#
- phylo2vec.from_pairs(pairs: List[Tuple[int, int]]) ndarray[source]#
Convert a list of pairs to a Phylo2Vec vector
Each pair is represented as a tuple (B, L) indicating that leaf L descends from branch B.
- Parameters:
pairs (List[Tuple[int, int]]) – List of (branch, leaf) pairs
- Returns:
v – Phylo2Vec vector
- Return type:
numpy.ndarray