im reading a csv file and then writing a new one:
import csv with open(\'thefile.csv\', \'rb\') as f: data = list(csv.reader(f)) import collections count
with open('/pythonwork/thefile_subset1.csv', 'w') as outfile: writer = csv.writer(outfile) for row in data: if counter[row[11]] >= 500: writer.writerow(row)