Skip to content

Latest commit

 

History

History

Flatten-dict

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Flatten Dict

You have a nested dictionary, the level of nesting is arbitrary and unknown in advance. Dictionary keys at any level can only be strings, values can only be numbers or other dictionaries. Given the conditions, you need to convert this nested dictionary into a flat one, where the keys are formed by the concatenation of nested keys connected by the “_” sign. To do this, you need to implement the flatten_dict function.



Test data