alifestd_mark_csr_children_asexual

alifestd_mark_csr_children_asexual(phylogeny_df: DataFrame, mutate: bool = False, *, mark_as: str = 'csr_children') DataFrame

Add column csr_children, a flat array of child ids grouped by parent according to CSR offsets from the csr_offsets column.

The output column name can be changed via the mark_as parameter.

Entries are ordered so that node i’s children occupy positions csr_offsets[i] to csr_offsets[i] + num_children[i] (exclusive). Entries beyond the total number of non-root nodes are unused.

A topological sort will be applied if phylogeny_df is not topologically sorted. Dataframe reindexing (e.g., df.index) may be applied.

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.