leaspy.io.data.abstract_dataframe_data_reader

Classes

AbstractDataframeDataReader

Methods to convert pandas.DataFrame to Leaspy-compliant data containers.

Module Contents

class AbstractDataframeDataReader[source]

Methods to convert pandas.DataFrame to Leaspy-compliant data containers.

Raises:
LeaspyDataInputError
time_rounding_digits = 6
individuals: dict[IDType, IndividualData]
iter_to_idx: dict[int, IDType]
n_individuals: int = 0
read(df, *, drop_full_nan=True, sort_index=False, warn_empty_column=True)[source]

The method that effectively reads the input dataframe (automatically called in __init__).

Parameters:
dfpandas.DataFrame

The dataframe to read.

drop_full_nanbool

Should we drop rows full of nans? (except index)

sort_indexbool

Should we lexsort index? (Keep False as default so not to break many of the downstream tests that check order…)

warn_empty_columnbool

Should we warn when there are empty columns?

Parameters:
Return type:

None