map_structures()

Apply all mapping components from a StructureMap to a DataFrame.

Usage

Source

map_structures(
    df,
    structure_map,
    verbose=False,
)

Separates the maps by type and applies them in order: FixedValueMap, ImplicitComponentMap, ComponentMap, MultiComponentMap.

Parameters

df: pd.DataFrame

The source dataset.

structure_map: px.model.map.StructureMap

A StructureMap containing various mapping components.

verbose: bool = False
If True, print logs about applied mappings.

Returns

pd.DataFrame
Modified DataFrame with all mappings applied.