X-Git-Url: https://projects.mako.cc/source/harrypotter-wikipedia-cdsw/blobdiff_plain/c3aed8c1b52241fa1ab6355a60a8327686a7ecd3..b442c1dd6b465527d63b469a210a88267249d8f9:/harrypotter_minor_edits.ipynb diff --git a/harrypotter_minor_edits.ipynb b/harrypotter_minor_edits.ipynb deleted file mode 100644 index 135f4be..0000000 --- a/harrypotter_minor_edits.ipynb +++ /dev/null @@ -1,77 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from csv import DictReader" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "input_file = open(\"hp_wiki.tsv\", 'r', encoding='utf-8')" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "num_edits = 0\n", - "num_anon = 0\n", - "for row in DictReader(input_file, delimiter=\"\\t\"):\n", - " num_edits = num_edits + 1\n", - " if row[\"anon\"] == \"True\":\n", - " num_anon = num_anon + 1\n", - "\n", - "prop_anon = num_anon / num_edits" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(f\"total edits: {num_edits}\")\n", - "print(f\"anon edits: {num_anon}\")\n", - "print(f\"proportion anon: {prop_anon}\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -}