Curriculum for the inaugural "Python Boot Camp" held for the Scottish Graduate Programme in Economics at the University of Edinburgh, June 3-7 2013. The curriculum mainly follows Think Python by Allen Downey, and the excellent SciPy lectures series on Scientific Programming in Python. Think Python is freely available on-line in both pdf and html. Solutions to exercises are also available. Code and additional documentation for the Scipy lecture series can be forked from its github repository.
- Chapter 1: The way of the program
- Chapter 2: Variables, expressions and statements
- Chapter 3: Functions
- Chapter 4: Case Study on Interface Design
For the afternoon sessions, I will switch from discussing the basics of Python programming to more specialized topics. I will start by covering Chapter 3 from Wes McKinney's book Python for Data Analysis on IPython. If you wish, you can download the code for the entire book by forking the book's github repository.
An in depth introduction to [NumPy]((http://www.numpy.org/). I will cover the entirety of lecture 1.3 from the SciPy lecture series. Note that much of this material is also covered, though in less detail, in Chapters 4 and 12 of Python for Data Analysis.
Basic plotting and data visualization using Matplotlib. I will cover the entirety of the lecture 1.4 from the SciPy lectures series.
- Chapter 11: Dictionaries
- Chapter 12: Tuples
- Chapter 13: Case Study on Data Structures
- Chapter 14: Files
Selected, economics relevant, topics from lecture 1.5 from the SciPy lecture series on high-level scientific computing using SciPy.
Introduction to object-oriented programming (OOP) and agent-based modelling (ABM) by replicating results from Allan Issac's paper on Simulating Evolutionary Games. You will write a program that will simulate a large number of agents repeatedly playing the Prisoner's Dilemma with one another. Along the way you will learn some of the basic concepts of OOP.
More detail on the theory/practice of OOP can be found in chapters 15-19 of Think Python:
- Chapter 15: Classes and Objects
- Chapter 16: Classes and Functions
- Chapter 17: Classes and Methods
- Chapter 18: Inheritance
- Chapter 19: Case Study on Tkinter
Hopefully, by this point you will have fallen in love with Python programming and want to know where you can learn more...
I have found the following books interesting/useful:
- Think Complexity: Picking up where Think Python leaves off, this book is about complexity science, data structures and algorithms, intermediate programming in Python, and the philosophy of science. Available in both .html and .pdf formats.
- Think Stats: Introduction to Bayesian and Frequentist statistics for Python programmers. Available in both .html and .pdf formats.
- Programming Collective Intelligence: Introduction to statistical learning theory and machine learning techniques for Python programmers. Potential gold-mine of economics research applications. I maintain a repository of the code for the entire book.
If you really want to become a Python Jedi Master, then I suggest that you put yourself through MIT's legendary CS 6.00 (Spring, 2011): Introduction to Computer Science and Programming. The fall 2008 version of the course is still relevant (and the lecturer is more engaging). Both of these courses include video lectures and recitations as well as the usual course materials.