alifestd_add_inner_niblings_polars

alifestd_add_inner_niblings_polars(phylogeny_df: DataFrame) DataFrame

For all inner nodes, add a subtending unifurcation, adding a “nibling” leaf as the child of the knuckle.

Here, “nibling” refers to a leaf that is a niece/nephew of the inner node.

Parameters

phylogeny_dfpolars.DataFrame or polars.LazyFrame

The phylogeny as a dataframe in alife standard format.

Must represent an asexual phylogeny with contiguous ids and topologically sorted rows.

Returns

polars.DataFrame

The phylogeny with inner niblings added.

See Also

alifestd_add_inner_niblings_asexual :

Pandas-based implementation.