-
Notifications
You must be signed in to change notification settings - Fork 83
Think python
Sketch curriculum for the inaugural "Python Boot camp" held for the Scottish Graduate Programme in Economics at the University of Edinburgh, June 3-7 2013.
Curriculum mainly follows Think Python by Allen Downey. The book is freely available on-line in both pdf and html.
- Chapter 1: The way of the program
- Chapter 2: Variables, expressions and statements
- Chapter 3: Functions
-
Chapter 4: Case Study Uses Swampy which can be downloaded from PyPi using
pip install swampy
from the command line.
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. The code for the entire book can be forked from it's github repository.
Basic plotting and data visualization using Matplotlib.
Chapters 4 and 12 on NumPy from Wes McKinney's book Python for Data Analysis.
- Chapter 11: Dictionaries
- Chapter 12: Tuples
- Chapter 13: Case Study Data structure selection.
- Chapter 14: Files Optional.
Some stuff to do with Scipy. But also might need to discuss Dynare and Dynare++ at some point. Maybe we can have break away sessions during the summer for those who are doing RBC/DSGE modelling for their MSc theses.
Today, I will introduce you to object-oriented programming (OOP) and agent-based modelling (ABM) by replicating results from Allan Issac's paper on Simulating Evolutionary Games. The objective will be to 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 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...
A good place to start is the SciPy lecture notes on Scientific Programming in Python.