alifestd_mark_lineage_cumprod_asexual
- alifestd_mark_lineage_cumprod_asexual(phylogeny_df: DataFrame, values: str, mutate: bool = False, *, mark_as: str = 'lineage_cumprod', reverse: bool = False, skipna: bool = True) DataFrame
Add column with cumulative product of
valuesalong each lineage.With
reverse=False(default), the result at each node is the product ofvaluesalong the path from the root to that node, inclusive. Withreverse=True, the result at each node is the product ofvaluesover the entire clade rooted at that node, inclusive.The output column name can be changed via the
mark_asparameter. NaN values are treated as 1 ifskipna(default), else propagate.Phylogeny must be asexual, topologically sorted, and have contiguous ids; otherwise
NotImplementedErroris raised.Input dataframe is not mutated by this operation unless
mutateis set True. If mutate set True, operation does not occur in place; still use return value to get transformed phylogeny dataframe.