This is an introductory course in programming and data analysis for public policy students with no prior coding experience; it is the first in Harris’s new data science sequence. It is for anyone who wants to gather, explore, and share raw quantitative data – or work with others who do. Students will learn:
Ultimately, students should be comfortable using what they’ve learned in further Harris/Chicago courses in programming and statistics (incl. Policy Lab) – and in research after leaving Harris. They should be confident independently finding and exploring new packages for those projects. They should know enough to productively collaborate on projects with engineers, and understand the potential of such work.
Throughout we’ll emphasize good practices for collaborative code development. Particularly after the first weeks, we’ll highlight how these skills apply to evaluating and improving policy.
Online documentation (‘docs’) will provide the principal written resources for the class; sources are listed for each week. For many code projects/’packages’ and languages, these sources are literally the standards that define how to use the products – and unlike books will keep up with the packages as they evolve. Locating these sources and using them to identify the methods or recipes you need is an important skill in coding. The most relevant starting sites for us will be for python 3.5 and pandas. You will also likely find the question site Stack Overflow very useful.
This said, two books published by O’Reilly are very good and available electronically through the UC library: Think Python (Allen Downey) and Python for data analysis (Wes McKinney). Seeing the material multiple times will help – so please use these resources!
Assignments will be due on Thursdays before first section (10:30am sharp) and will posted on this website at least one week in advance. Work will be collected through Chalk and GitHub, so get a student account here.
Unless otherwise noted, problem parts will be graded as follows:
The lowest homework grade will be dropped.
Since homework solutions will be posted and discussed in lab the following week, late homework can only be accepted until Sunday night with a 10% deduction for each late day (starting Thursdays after 10:30am). Notify the TAs to ‘pull’ when late homework is complete.
There will be a short (about 5 minutes) quiz in lecture every week after week 1.
We will follow the standard Harris curve: 1/8 A, 1/4 A-, 1/4 B+, 1/4 B, 1/8 B-.
Writing code is substantially different from writing essays: it is standard practice to find individual functions or google things that don’t work, and copy a line or two from the manual or stack overflow. I encourage you to discuss general strategies for solving problems with your classmates and friends. Questions and answers on the discussion board will naturally include code. However – you should never ask to see another’s solutions, and you absolutely should not copy code from your classmates. No one but you should type your code. If you find more than a single line/method, you should attribute the source in your comments.
Part of the overhead to doing computation is getting the software running. Students will therefore install the software required for the class on their personal laptops. This will enable them to straightforwardly continue using the skills that they develop, when the quarter is over.
You will need the command line (cygwin on PCs, Terminal on Mac), python (I will only support the Anaconda distribution), and a text editor (Atom). Installation instructions are posted for Mac and Windows. (If you’re using Linux, you can probably figure it out yourself.) This installation is the entire first week’s homework, but it will also be used in the first week’s classes! At a minimum, you should have Atom (and cygwin, for Windows) installed before the first class. We will hold multiple lab sessions in the first week to support installation of the software. You must get the help you need at that point – we won’t provide this support for the entire quarter.
Bring your laptop to every class – short demos will be an important part of the lectures.
The schedule below will be updated throughout the quarter with links to slides, homeworks, etc. Please check back often.
The homework assignment requires that your installation is complete. Please attend lab for help with this. It is absolutely required that your installation work. You MUST come to one of the six lab sessions or office hours One-on-one installation tech support after the first week is at the discretion of the TAs.
int
, float
, string
, dict
, list
, etc.if
, else
, break
, continue
) and iterating with for
and while
loops.
List Comprehension.A large example: the hospital-resident matching problem
Data Visualization with Python: matplotlib and pandas
group by
, order by
, limit
, max
, avg
, etc.