Created
January 10, 2015 21:41
-
-
Save rajaramanathan/a4e1b5b3531fd2b2cfab to your computer and use it in GitHub Desktop.
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
cols = [‘City’,’Country’,’ZipCode’] | |
values = [‘Paris’,’France’,’12345-12′] | |
zipped = zip(cols ,values) | |
print zipped #prints [(‘City’, ‘Paris’), (‘Country’, ‘France’), (‘ZipCode’, ‘12345-12′)] | |
dictionary = dict(zipped) #now just convert the zipped to a dictionary | |
print dictionary #prints {‘City': ‘Paris’, ‘ZipCode': ‘12345-12′, ‘Country': ‘France’} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment