Skip to content

Instantly share code, notes, and snippets.

@DenisCarriere
Created October 4, 2014 13:51
Show Gist options
  • Save DenisCarriere/9dd4459db6ab95d034f9 to your computer and use it in GitHub Desktop.
Save DenisCarriere/9dd4459db6ab95d034f9 to your computer and use it in GitHub Desktop.
Open CSV
import csv
with open(join('us-data', 'codes.txt')) as f:
rows = list(csv.DictReader(f, dialect='excel-tab'))
codes = dict([(row['Postal Code'].lower(), row['State']) for row in rows])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment