Python for Economic and Social Data Science/Python for Sociologists

Labs, Department of Sociology, University of Oxford, and Jinhe Center for Economic Research, Xi'an Jiaotong University, 2016

Date first taught: 2016-01-01.

Date last taught: 2024-07-31.

The material is designed to last for about twenty hours, split across five ‘lectures’.

  • Lecture One: Basic object types and an introduction to collections (tenatively Day One, 13:00-1700)
  • Lecture Two: Iterating over a collection, Boolean logic, advanced loops, user input and error handling (tenatively Day Two, 13:00-17:00)
  • Lecture Three: Pseudocode, functions, file I/O, programming outside of Python, Numpy (tenatively Day Three, 13:00-17:00)
  • Lecture Four: Random numbers, webscraping, Pandas (tenatively Day Four, 13:00-16:00)
  • Lecture Five: Matplotlib, statsmodels, RobustiPy, NLTK, scikit-learn (tenatively Day Five, 13:00-17:00)

The classes should take between three to four hours. The first part of each of the second through fifth days will be a review of the homeworks. The class on Day Four needs to end one hour earlier. One ‘lecture’ doesn’t necessarily correspond to one day: if we finish one lecture earlier on a specific day, we can move the next lecture. If we finish all five days of content early, we can spend the remaining time working on and discussing your own specific projects which you want to use Python for. At the end of each section of the notebooks, we will take a break from the lecture and you can play around in the notebooks following the set example question (which will then be live coded afterwards when the lectures resume). All teaching material is available here.