Created
February 20, 2014 02:18
-
-
Save rebeccawilliams/9105832 to your computer and use it in GitHub Desktop.
little script to sort massive 311 csv: http://opendatadc.org/dataset/3-1-1-service-request-data-1999-2014
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
import csv | |
requests = open("DC311.csv") | |
tags = open("graffiti.csv", 'w') | |
read_file = csv.reader(requests) | |
write_file = csv.writer(tags) | |
Graffiti = 0 | |
for line in read_file: | |
if line[5].strip() == 'Graffiti': | |
Graffiti += 1 | |
write_file.writerow(line) | |
print "There are %s Graffiti Removla service requests in DC as of 2009" % (Graffiti) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment