5 "execution_count": null,
9 "from csv import DictReader"
14 "execution_count": null,
18 "input_file = open(\"hp_wiki.tsv\", 'r', encoding='utf-8')"
23 "execution_count": null,
29 "for row in DictReader(input_file, delimiter=\"\\t\"):\n",
30 " num_edits = num_edits + 1\n",
31 " if row[\"anon\"] == \"True\":\n",
32 " num_anon = num_anon + 1\n",
34 "prop_anon = num_anon / num_edits"
39 "execution_count": null,
43 "print(f\"total edits: {num_edits}\")\n",
44 "print(f\"anon edits: {num_anon}\")\n",
45 "print(f\"proportion anon: {prop_anon}\")"
50 "execution_count": null,
58 "display_name": "Python 3",
67 "file_extension": ".py",
68 "mimetype": "text/x-python",
70 "nbconvert_exporter": "python",
71 "pygments_lexer": "ipython3",