parse_string_to_dict

parse_string_to_dict#

powerplantmatching.utils.parse_string_to_dict(df, cols)#

Convenience function to convert string of dict to dict type for specified columns.

Parameters:
  • df (pd.DataFrame) – DataFrame on which to apply the parsing

  • cols (str, list) – Column(s) to be parsed to dict type

Returns:

DataFrame with specified columns parsed to dict type

Return type:

pd.DataFrame