Skip to content

Instantly share code, notes, and snippets.

@mittenchops
Created July 12, 2013 14:03
Show Gist options
  • Save mittenchops/5984700 to your computer and use it in GitHub Desktop.
Save mittenchops/5984700 to your computer and use it in GitHub Desktop.
flatten a dictionary of lists
# http://feldboris.alwaysdata.net/blog/python-trick-how-to-flatten-dictionaries-values-composed-of-iterables.html
from itertools import chain
def flatten_dict_values(dictionary):
return chain(*dictionary.values())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment