Permalink
Browse files

added some more comments on parsing techniques

  • Loading branch information...
1 parent fa655e6 commit 4e7b65c6c6c77323dd43ca691cea565c85339b68 @neilkod committed Oct 7, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 county_fips_codes_for_zip_codes.py
@@ -15,6 +15,12 @@
for line in fips_data:
data = line.strip()
fips_cd = data[0:5]
+
+ # making sure that we're dealing with zip code records
+ # and not header records.
+ # also filter out fips codes that end in 000 because those are records
+ # for a state as a whole i.e. 10000 is alabama.
+
if fips_regex.match(fips_cd) and fips_cd[2:5] != '000':
county_name, state_cd = data[6:].split(',')
state_cd = state_cd.replace(' ','')

0 comments on commit 4e7b65c

Please sign in to comment.