alifestd_prune_extinct_lineages_polars
- alifestd_prune_extinct_lineages_polars(phylogeny_df: DataFrame, *, criterion: str = 'extant') DataFrame
Drop taxa without extant descendants.
The criterion column is used to determine extant taxa.
Parameters
- phylogeny_dfpolars.DataFrame
The phylogeny as a dataframe in alife standard format.
Must represent an asexual phylogeny.
- criterionstr, default “extant”
Column name used to determine extant taxa.
Raises
- NotImplementedError
If phylogeny_df has no “ancestor_id” column.
- NotImplementedError
If phylogeny_df has non-contiguous ids.
- NotImplementedError
If phylogeny_df is not topologically sorted.
- ValueError
If criterion is not a column in phylogeny_df.
Returns
- polars.DataFrame
The pruned phylogeny in alife standard format.
See Also
- alifestd_prune_extinct_lineages_asexual :
Pandas-based implementation.