dataherb.utils.data
utils.data¤
flatten_dict(nested_dict, sep=None)
¤
flatten_dict flattens a dictionary,
The flattened keys are joined using a separater which is default to '__'.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nested_dict |
dict
|
input nested dictionary to be flattened. |
required |
sep |
str, optional
|
seperator for the joined keys, defaults to __ |
None
|
Returns:
Type | Description |
---|---|
dict
|
flattened dictionar |
Source code in dataherb/utils/data.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|