Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
recursion solution in Clear category for The Flat Dictionary by yoichi
def flatten(dictionary):
result = {}
for k, v in dictionary.items():
if v and isinstance(v, dict):
for vk, vv in flatten(v).items():
result['/'.join([k, vk])] = vv
else:
result[k] = v or ''
return result
April 14, 2019
Comments: