Python for economics

Python for economics

Earlier this year - or what feels like a lifetime ago - Antonio Mele (LSE) and I ran a python weekend for undergraduate economics students. It was the first time we had run such a programme, and it wasn’t without its challenges, but it was a great experience for what feels like the future of economics.

The aim was to introduce students to elements of computational economics and provide an insight into what economic questions can be answered through programming languages such as python.

The material is shared below and while python was our language of choice, we made clear that python is part of a wider toolkit of languages that should be available to you. Students were required to have a basic understanding of python and completion of this course as a prerequisite. (An understanding of functions, loops and if statements would be a huge help too - this website covers almost everything!)

We also had a number of panellists who work in industry and academia to share their experience using python to solve economics questions. The suggested a number of resources to help begin your python journey.

  1. Quantitative economics with python. here. A set of lectures on quantitative economic modelling, with worked examples and exercises.

  2. MIT introduction to computer science and programming in python. Online MOOC available here.

  3. Harvard Introduction to computer science. Another online MOOC here.

  4. Introduction to statistical learning. Being comfortable with the statistics is important, and this book starts with the very basics. It also has an appendix with R code and corresponding datasets can be found here.

  5. 3Blue1Brown. Youtube videos to improve your understanding of linear algebra, check out the playlist here.

  6. Python for data analysis (book). A practical book covering the basics of pandas all the way to time series and advanced NumPy with plenty of examples; O’Reily have a number of helpful books.

  7. GitHub. Look at other people’s code and understand how packages are written which will help you later when writing your own packages.

  8. Attend sprints. Contribute to open source, learn through mistakes and collaboration.

  9. Do something you enjoy! The most often (aside from confidence with statistics) was to work on a project that you feel passionate about. Learn through doing and making mistakes. Practise, practise, practise.

Chart of the Week: The rainy day fund

Chart of the Week: The rainy day fund

Chart of the Week: Argentine Anxieties

Chart of the Week: Argentine Anxieties