Parsing files with county codes
I think you're pretty close to optimal here. I made a few tweaks, to avoid some conditionals by using sets instead. I don't actually know if it'll run faster; you'll need to benchmark it, and it likely depends on the breakdown of how many dupes per county there are.

def get_codes3(data):
    from collections import defaultdict
    codeinfo = defaultdict(set)
    for row in data:
        county = row["county"]
        # remove float() if you can get away with it - are there
        # actually values like '1.5' in the data?
        code = int(float(row["code"]))
        if code &gt; 100000:
            code = code/100

        codeinfo[county].add(code)
    # if you can get away with sets instead of lists in your return
    # value, you're good
    return code_info
    # otherwise:
    # return dict([(county, list(info)) for county, info in code_info.iteritems()])



You don't need float() unless the data is actually like "123.45" - it's not clear if that's the case
sets can work in most places that lists work, so you might not need to convert to a list
It might be worth it to write a script that does just the x = x/100 if x &gt; 100000 part and writes that out to a new file