alifestd_mark_num_descendants_polars

alifestd_mark_num_descendants_polars(phylogeny_df: DataFrame, *, mark_as: str = 'num_descendants') DataFrame

Add column num_descendants, excluding self.

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

Parameters

phylogeny_dfpolars.DataFrame

The phylogeny as a dataframe in alife standard format.

Must represent an asexual phylogeny.

Returns

polars.DataFrame

The phylogeny with an added num_descendants column.

See Also

alifestd_mark_num_descendants_asexual :

Pandas-based implementation.