Skip to content

Instantly share code, notes, and snippets.

@richard-to
Created July 28, 2014 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richard-to/0fb1e384084c20ffaa42 to your computer and use it in GitHub Desktop.
Save richard-to/0fb1e384084c20ffaa42 to your computer and use it in GitHub Desktop.
Random snippet to zip separate columns into list and then turn each row into dict.
keys = ('FacilityID', 'FacilityName', 'City', 'Zip', 'Score', 'InspDate')
facilities_data = [data[key].split('|') for key in keys]
facilities = [dict(zip(keys, row)) for row in zip(*facilities_data)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment