alifestd_mark_root_id
- alifestd_mark_root_id(phylogeny_df: ~pandas.core.frame.DataFrame, mutate: bool = False, selector: ~typing.Callable = <built-in function min>, *, mark_as: str = 'root_id') DataFrame
Add column root_id, containing the id of entries’ ultimate ancestor.
The output column name can be changed via the
mark_asparameter.For sexual data, the field root_id is chosen according to the selection of callable selector over parents’ root_id values. Note that subsets within a connected component may be marked with different root_id values. To create a component id that is consistent within connected components, a backward pass could be performed that updates ancestors’ values if they are greater than that of each descendant.
Input dataframe is not mutated by this operation unless mutate set True. If mutate set True, operation does not occur in place; still use return value to get transformed phylogeny dataframe.