Skip to content

Instantly share code, notes, and snippets.

@thomasaarholt
Last active February 27, 2024 15:14
Show Gist options
  • Save thomasaarholt/19f8ab4c64237417cd341a02f5aec3f4 to your computer and use it in GitHub Desktop.
Save thomasaarholt/19f8ab4c64237417cd341a02f5aec3f4 to your computer and use it in GitHub Desktop.
def nested_dict_to_df(nested_dict):
left = []
right = []
value = []
for outer_key, inner_dict in nested_dict.items():
for inner_key, val_list in inner_dict.items():
left.append(outer_key)
right.append(inner_key)
value.append(list(val_list))
return left, right, value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment