nip.utils.data.flatten_dict_keys

nip.utils.data.flatten_dict_keys#

nip.utils.data.flatten_dict_keys(data: dict, separator: str = '.', prefix: str = '') dict[source]#

Flatten a nested dictionary by joining keys with a separator recursively.

Parameters:
  • data (dict) – The nested dictionary to flatten.

  • separator (str, default=".") – The separator to use between keys.

  • prefix (str, default="") – The prefix to add to the keys.

Returns:

flat_data (dict) – The flattened dictionary with joined keys.