pyufunc.dict_flatten#

pyufunc.dict_flatten(mapping, *, separator='_', indexes=False)#

Flatten a nested dictionary.

Parameters:
  • mapping – Source mapping.

  • separator – Separator inserted between nested keys.

  • indexes – If True, include list indexes in flattened keys.

Note

Example

>>> dict_flatten({"a": {"b": 1}})
{'a_b': 1}
Returns:

Flattened dictionary.

Return type:

dict[str, Any]