improvements based on a run-through in COM597G
[harrypotter-wikipedia-cdsw] / hpwp-minor.py
index 4e173f2..c327015 100644 (file)
@@ -1,12 +1,12 @@
 from csv import DictReader
 
-input_file = open("hp_wiki.csv", 'r')
+input_file = open("hp_wiki.tsv", 'r', encoding="utf-8")
 
 num_edits = 0
 num_anon = 0
-for row in DictReader(input_file):
+for row in DictReader(input_file, delimiter="\t"):
     num_edits = num_edits + 1
-    if row["anon"] == "False":
+    if row["anon"] == "True":
         num_anon = num_anon + 1
 
 prop_anon = num_anon / num_edits

Benjamin Mako Hill || Want to submit a patch?