sidpy.base.dict_utils.flatten_dict

sidpy.base.dict_utils.flatten_dict(nested_dict, separator='-')[source]

Flattens a nested dictionary

Parameters:
  • nested_dict (dict) – Nested dictionary

  • separator (str, Optional. Default='-') – Separator between the keys of different levels

Returns:

Dictionary whose keys are flattened to a single level

Return type:

dict

Notes

Taken from https://stackoverflow.com/questions/6027558/flatten-nested- dictionaries-compressing-keys