Editing Community Data Science Workshops (Core)/Day 3 Lecture
From CommunityData
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
Welcome to the Saturday lecture section of the Community Data Science Workshop Session 3! For about 140 minutes, we'll work through an example of a Python program end-to-end that answers of simple questions using data from the Wikipedia API via both a lecture and hand-on exercises. | Welcome to the Saturday lecture section of the Community Data Science Workshop Session 3! For about 140 minutes, we'll work through an example of a Python program end-to-end that answers of simple questions using data from the Wikipedia API via both a lecture and hand-on exercises. | ||
== Material for the lecture == | == Material for the lecture == | ||
Line 11: | Line 5: | ||
For the lecture, you will need two files. Download both of these to your computer by using right or control click on the link and then using ''Save as'' or ''Save link as''. Keep track of where you put the files. | For the lecture, you will need two files. Download both of these to your computer by using right or control click on the link and then using ''Save as'' or ''Save link as''. Keep track of where you put the files. | ||
* | * http://mako.cc/teaching/2015/cdsw-autumn/harrypotter-wikipedia-cdsw.zip | ||
* http://communitydata. | * http://communitydata.cc/~mako/hp_wiki.tsv | ||
== Overview of the day == | == Overview of the day == | ||
Line 27: | Line 21: | ||
** Your own projects! | ** Your own projects! | ||
** Review Cafe | ** Review Cafe | ||
* Wrap-up! | * Wrap-up! | ||
Line 47: | Line 40: | ||
'''Step 2: Walking through a Program''' | '''Step 2: Walking through a Program''' | ||
* Walk-through of <code> | * Walk-through of <code>get_hpwp_dataset.py</code> | ||
* Look at dataset with | * Look at dataset with <code>more</code> and/or in spreadsheet | ||
'''Step 3: Loading Data Back In''' | '''Step 3: Loading Data Back In''' | ||
Line 56: | Line 49: | ||
*** we can also open them for reading with <code>open('file', 'r', encoding="utf-8")</code> | *** we can also open them for reading with <code>open('file', 'r', encoding="utf-8")</code> | ||
** csv.DictReader() | ** csv.DictReader() | ||
* Basic counting: <code> | * Basic counting: <code>hpwp-minor.py</code> | ||
** Answer question: ''What proportion of edits to Wikipedia Harry Potter articles are minor?'' | ** Answer question: ''What proportion of edits to Wikipedia Harry Potter articles are minor?'' | ||
*** Count the number of minor edits and calculate proportion | *** Count the number of minor edits and calculate proportion | ||
* Looking at time series data <code> | * Looking at time series data <code>hpwp-trend.py</code> | ||
** "Bin" data by day to generate the trend line | ** "Bin" data by day to generate the trend line | ||
* Exporting and visualizing data | * Exporting and visualizing data |