Editing Community Data Science Workshops (Core)/Day 3 Lecture

From CommunityData

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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:
{{Template:CDSW Header}}
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.
'''Resources''':
* [https://communitydata.science/~mako/cdsw-wi2020-lecture3-20200215.ogv  Screencast/recording of the Winter 2020 lecture] (859MB) — The file should be viewable in Firefox and many other browsers. If you have trouble playing it, you can download [https://www.videolan.org/vlc/index.html the VLC media player] which will be a able to play it on Windows, OSX, or GNU/Linux.


== Material for the lecture ==
== Material for the lecture ==
Line 47: Line 41:
'''Step 2: Walking through a Program'''
'''Step 2: Walking through a Program'''


* Walk-through of <code>build_harry_potter_dataset.ipynb</code>
* Walk-through of <code>get_hpwp_dataset.py</code>
* Look at dataset with Jupyter and/or in spreadsheet
* 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 50:
*** 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>harrypotter_anon_edits.ipynb</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>harrypotter_edit_trend.ipynb</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
Please note that all contributions to CommunityData are considered to be released under the Attribution-Share Alike 3.0 Unported (see CommunityData:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)

Template used on this page: