Python For Economists

Professor, University of Bologna, Department of Economics, 2024

In this class, I taught python from scratch to master’s students. I covered set-up, base python use, base econometrics, webscraping, text analysis, GIS data and bits of machine learning.

Class 1 - Set up

Class 1 was about the very basics of Python. Including installing anaconda to manage packages and spyder as the main IDE for the class. The class itself uses jupyter notebook with Rise to be read and presented as a slideshow.

Use the pdf slides to install python, then read the notebook for the first bits of programming.

Class 2 - Base Python

Class 2 dives a bit deeper in base python functioning, and starts doing some econometrics.

Class 3 - Simulation and the use of pandas

Class 3 leverages on the eurostat API to get some data and perform some basic analysis.

Class 4 - Simulation and Econometrics

With simulated data, performs power analysis by increasing the sample of the simulations

Class 5 - webscraping

Starts webscraping, with requests

Class 6 - webscraping cont’d

Find out how to equip webscraper with cookies and headers. Webscrape and analyzes the members of the Italian parliament. Finally, how to use selenium to webscrape javascript intensive websites.

Class 7 & 8 - Text analysis

Not the best class of this series, would recommend going to other sources for text analysis.

Class 9 & 10 - GIS data

This covers GIS data, with small bits of machine learning at the very end (mostly a recommendation to follow fastai class)