sidpy.base.dict_utils.nest_dict

sidpy.base.dict_utils.nest_dict(flat_dict, separator='-')[source]

Generates a nested dictionary from a flattened dictionary

Parameters:
  • flat_dict (dict) – Dictionary whose keys are flattened to a single string with a separator

  • separator (str, optional. Default = '-') – Separator used to delimit the levels in the keys

Returns:

nested_dict – Nested dictionary

Return type:

dict

Notes

flat_dict should look like {‘A|B|C’: V1, ‘A|B|D’: V2, …}