Community Data Science Course (Spring 2015)/Day 5 Lecture
From CommunityData
Material for the lecture[edit]
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/community_data_science/build_hpwp_dataset.py
- http://communitydata.cc/~mako/hp_wiki.csv
Overview of the day[edit]
- Lecture
- 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
Lecture outline[edit]
- My philosophy about data analysis: use the tools you have
- Three new thing in Python I have to teach you:
- string.join()
- defining your own functions with
def foo(argument):
- loading data back into Python (which we'll cover once we have some data)
- Walk-through of
get_hpwp_dataset.py
- Look at dataset with
more
and/or in spreadsheet- review of opening files
- we can also open them for reading
- csv module and and csv.reader() function
- csv.DictReader()
- review of opening files