Created
July 28, 2014 15:32
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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