4.5. dict_and_df_converters module¶
- dict_and_df_converters.convert_dict_to_df(dict_to_convert, *args)[source]¶
- Note:
This function converts a dictionary to a DataFrame.
- Parameters:
dict_to_convert: A dictionary meant for conversion to a DataFrame.
args: The arguments to use as column names for the separated keys.
- Return:
A DataFrame containing the passed dictionary of data with additional columns based on args.
- dict_and_df_converters.create_costs_dict(df, id_cols)[source]¶
- Note:
This function creates a dictionary from the passed DataFrame, specifically for cost-related DataFrames.
- Parameters:
df: A DataFrame to be converted to a dictionary.
id_cols: The identifying columns (args) from the DataFrame to use as keys for the returned dictionary.
- Return:
A dictionary based on the passed DataFrame with keys consisting of id_cols plus Disc-Rate (added) and with id_cols removed.
- dict_and_df_converters.create_effects_dict(df, id_cols)[source]¶
- Note:
This function creates a dictionary from the passed DataFrame, specifically for effects-related DataFrames.
- Parameters:
df: A DataFrame to be converted to a dictionary.
id_cols: The identifying columns (args) from the DataFrame to use as keys for the returned dictionary.
- Return:
A dictionary based on the passed DataFrame with keys consisting of id_cols and with id_cols removed.