pydpeet.mapping#

pydpeet.mapping(data_frame, column_map, missing_columns)[source]#

Renames and maps specific columns in the DataFrame to standardized names. If a standardized column doesn’t exist in the DataFrame, it is added with default None values. Non-mapped columns will remain unchanged in the resulting DataFrame.

Parameters: data_frame (pandas.DataFrame): The input DataFrame to be processed. column_map (dict): A dictionary mapping existing column names to new standardized names. missing_columns (list): A list of column names to ensure their existence in the DataFrame.

Returns: pandas.DataFrame: The updated DataFrame with standardized column names.

Assumptions: column_map and missing_columns contain all standard columns (If you want to rename more or add more columns do it after the conversion)

Parameters:
  • data_frame (DataFrame)

  • column_map (dict)

  • missing_columns (list)

Return type:

DataFrame