fix comments to include the full url being created
[harrypotter-wikipedia-cdsw] / hpwp-minor.py
1 from csv import DictReader
2
3 input_file = open("hp_wiki.tsv", 'r', encoding="utf-8")
4
5 num_edits = 0
6 num_anon = 0
7 for row in DictReader(input_file, delimiter="\t"):
8     num_edits = num_edits + 1
9     if row["anon"] == "True":
10         num_anon = num_anon + 1
11
12 prop_anon = num_anon / num_edits
13
14 print("total edits: {0}".format(num_edits))
15 print("anon edits: {0}".format(num_anon))
16 print("proportion anon: {0}".format(prop_anon))

Benjamin Mako Hill || Want to submit a patch?