alifestd_from_avida_spop

alifestd_from_avida_spop(spop_text: str, *, create_ancestor_list: bool = True, dtype_id: type | None = <class 'numpy.int64'>) DataFrame

Convert Avida .spop population snapshot text to a phylogeny dataframe.

Parses the text content of an Avida .spop (structured population) file and returns a pandas DataFrame in alife standard format.

Parameters

spop_textstr

Full text content of an Avida .spop file.

create_ancestor_listbool, default True

If True, include an ancestor_list column in the result.

dtype_idtype or None, default np.int64

Numpy dtype for the id column. If None, the smallest signed integer dtype is chosen automatically based on the number of rows in the data.

Returns

pd.DataFrame

Phylogeny dataframe in alife standard format.

See Also

alifestd_from_avida_spop_polars :

Polars-based implementation.

Raises

ValueError

If the #format header is missing from the spop text.