Editing Community Data Science Course (Spring 2015)/Day 5 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 17: | Line 17: | ||
* My philosophy about data analysis: ''use the tools you have'' | * 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() | ** string.join() | ||
** defining your own functions with <code>def foo(argument):</code> | ** defining your own functions with <code>def foo(argument):</code> | ||
* Walk-through of <code>get_hpwp_dataset.py</code> | * Walk-through of <code>get_hpwp_dataset.py</code> | ||
* Look at dataset with <code>more</code> and/or in spreadsheet | * Look at dataset with <code>more</code> and/or in spreadsheet | ||
* Load data into Python | |||
** review of opening files | ** review of opening files | ||
*** we can also open them for reading | *** 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() | ||
* 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 |