Skip to content

Instantly share code, notes, and snippets.

@israelst
Created October 1, 2015 21:02
Show Gist options
  • Save israelst/d2eb21e930dfa6e9fb0e to your computer and use it in GitHub Desktop.
Save israelst/d2eb21e930dfa6e9fb0e to your computer and use it in GitHub Desktop.
Return a list of unique keys from a list of dicts.
def keys_from_dicts(dicts):
all_keys = sum(map(dict.keys, dicts), [])
return list(set(all_keys))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment