phenotypic.util.split_measurements#

phenotypic.util.split_measurements(df: DataFrame | DataFrame) dict[str, DataFrame | DataFrame][source]#

Split a measurements table into producer-specific data frames.

Columns backed by public MeasureFeatures and SetAnalyzer MeasurementInfo enums define each split. Columns that do not belong to any producer-owned enum are preserved in every split as context columns.

Parameters:

df (DataFrame | DataFrame) – A pandas or polars measurements DataFrame.

Returns:

Mapping of producer class name to a same-type DataFrame containing all context columns plus that producer’s recognized measurement columns. Returns an empty mapping when no producer-owned measurement columns are present.

Raises:

TypeError – If df is not a pandas or polars DataFrame.

Return type:

dict[str, DataFrame | DataFrame]