Community Data Science Workshops (Fall 2014)/Day 3 lecture: Difference between revisions

From OpenHatch wiki
Content added Content deleted
imported>Mako
imported>Mako
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{CDSW Moved}}

== Material for the lecture ==
== Material for the lecture ==


Line 14: Line 16:
** We'll focus on manipulating data in Python
** We'll focus on manipulating data in Python
** Visualizing things in Google Docs
** Visualizing things in Google Docs
* Lunch (not Pizza!)
* Lunch (vegetarian Greek!)
* Project based work
* Project based work
** Project and challenge based continuition of the work in here focusing on Google Docs
** Project and challenge based continuition of the work in here focusing on Google Docs
Line 26: Line 28:
* Four things in Python I have to teach you:
* Four things in Python I have to teach you:
** while loops
** while loops
*** infinite loops
*** loops with a greater than or less than
** break / continue
** break / continue
** string.join()
** string.join()
Line 33: Line 37:
* Load data into Python
* Load data into Python
** review of opening files
** review of opening files
*** we can also open them for reading
** csv module and and csv.reader() function
** csv module and and csv.reader() function
** csv.DictReader()
** csv.DictReader()
Line 38: Line 43:
** 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
** Answer question: ''What proportion of edits to Wikipedia Harry Potter articles are made by "anonymous" contributors?''
** "Bin" data by day to generate the trend line
*** Count the number of anonymous edits and calculate proportion
* Exporting and visualizing data
** Export dataset on edits over time
** Export dataset on articles over users
** Load data into Google Docs


We mostly worked on these questions in the afternoon:
We mostly worked on these questions in the afternoon:
Line 48: Line 57:
** Answer question: ''Who are the most active editors on articles in Harry Potter?''
** Answer question: ''Who are the most active editors on articles in Harry Potter?''
*** Count the number of edits per user
*** Count the number of edits per user
* Looking at time series data
** "Bin" data by day to generate the trend line
* Exporting and visualizing data
** Export dataset on edits over time
** Export dataset on articles over users
** Load data into Google Docs

Latest revision as of 22:00, 15 March 2015

Page Moved
All material related to the Community Data Science Workshops have been moved from the OpenHatch wiki to a new dedicated wiki and this page is no longer being updated here. Please visit the new version of the page on the Community Data Science Collective wiki.

Material for the lecture

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.

Overview of the day

  • Lecture
    • Our philosophy around data visualization
    • Introduce some new programming tools!
    • We're going to walk through some analysis of edits to Harry Potter in Wikipedia, start to finish
    • We'll focus on manipulating data in Python
    • Visualizing things in Google Docs
  • Lunch (vegetarian Greek!)
  • Project based work
    • Project and challenge based continuition of the work in here focusing on Google Docs
    • Matplotlib!
    • Room for you to to work on your projects!
  • Wrap-up!

Lecture outline

  • My philosophy about data analysis: use the tools you have
  • Four things in Python I have to teach you:
    • while loops
      • infinite loops
      • loops with a greater than or less than
    • break / continue
    • string.join()
    • defining your own functions with def foo(argument):
  • Walk-through of get_hpwp_dataset.py
  • Look at dataset with more and/or in spreadsheet
  • Load data into Python
    • review of opening files
      • we can also open them for reading
    • csv module and and csv.reader() function
    • csv.DictReader()
  • Basic counting
    • Answer question: What proportion of edits to Wikipedia Harry Potter articles are minor?
      • Count the number of minor edits and calculate proportion
  • Looking at time series data
    • "Bin" data by day to generate the trend line
  • Exporting and visualizing data
    • Export dataset on edits over time
    • Export dataset on articles over users
    • Load data into Google Docs

We mostly worked on these questions in the afternoon:

  • More advanced counting
    • Answer question: What are the most edited articles on Harry Potter?
      • Count the number of edits per articles
    • Answer question: Who are the most active editors on articles in Harry Potter?
      • Count the number of edits per user