get_level_dataframe

get_level_dataframe(df: pandas.core.frame.DataFrame, mapping_matrix: scipy.sparse._csr.csr_matrix, source_level_segments: List[str], target_level_segments: List[str])[source]

Perform mapping to dataframe at the target level.

Parameters
  • df (pandas.core.frame.DataFrame) – dataframe at the source level

  • mapping_matrix (scipy.sparse._csr.csr_matrix) – mapping matrix between levels

  • source_level_segments (List[str]) – list of segments at the source level, set the order of segments matching the mapping matrix

  • target_level_segments (List[str]) – list of segments at the target level

Returns

dataframe at the target level