DPIR Introduction to Python for Social Science Repository

View the Project on GitHub muhark/dpir-intro-python

Introduction to Python for Social Science

Welcome to the official course website for the Introduction to Python for Social Science optional methods module at the Department of Politics and International Relations, University of Oxford.

I will be posting all slides, workbooks, practice sets and solutions on this website. Recorded lectures will be hosted on Canvas/Panopto (and linked here if possible). Information regarding office hours will be sent out in the coming days.

Course Details

Lectures will be held weekly on Wednesdays from 4pm to 6pm (GMT) on Teams. Office hours will be confirmed in the coming days. I will do my best to upload recorded lectures as quickly as I can.

You can find a syllabus for the course here.

Lecture Slides

I’m using reveal.js for the lecture slides, so they should be viewable in the browser on any device. pdf (beamer) format slides are also available lower down the page.

You might note that the previous year’s slides are still accessible via the linked GitHub. Please note that there are some substantial changes being made to the course, and the slides in the GitHub may not reflect this yet.

  1. Introduction to Python and the Development Environment
  2. Data Structures and pandas I
  3. Data Structures and pandas II
  4. Data Visualisation
  5. Machine Learning with scikit-learn I
  6. Machine Learning with scikit-learn II
  7. Mining the Web I
  8. Mining the Web II


Week reveal.js Code Examples Code Exercises Code Solutions Data
1 slides examples exercises solutions None
2 slides examples exercises solutions BES
3 slides examples exercises solutions None
4 slides examples exercises solutions None
5 slides examples exercises solutions None
6 slides examples exercises solutions None
7 slides examples exercises solutions None
8 slides Twitter API Selenium None None None

About Me

My name is Musashi Harukawa, I am a DPhil Politics student at the University of Oxford. Prior to returning to academia, I worked as a quantitative analyst/data scientist at a stock exchange in Tokyo and an English teacher in Moscow.

My research interests fall into two areas. In methods, I am working on non-parametric methods for model selection and applications of manifold learning to descriptive inference with social trace data. My substantive research looks at micro-targeted political advertising.


“Estimating the Micro_Targeting Effect: Evidence from a Survey Experiment During the 2020 U.S. Presidential Election”, WIP, Link to Presentation “Comparative Government Revision Class”