To use Jupyter (Python) notebooks in the cloud, your options are:
- Google Colab: this is pretty robust and has been around for a while. It's integrated with Google Drive and has the option of upgrading to better hardware.
- Kaggle Kernels: similar to Google Colab, and allows you to pull in pre-arranged data sources.
- Deepnote: this is relatively new but has a very slick interface. Seems to work well from my limited testing, and it's easy to upload arbitrary files.
Alternatively, if you'd like to install Python and Jupyter on your computer, you can either use "pure" Python or the slightly more user-friendly Anaconda. To get pure Python go to: https://www.python.org/downloads. To get Anaconda, download Miniconda at: https://docs.conda.io/en/latest/miniconda.html.
Once you've installed Python, you need to download some packages. For pure Python, you can do this with the pip
command, and for Anaconda you can use the conda
command. For parts 1 and 2 of this tutorial, you'll need the modules listed in requirements.txt
. For part 3, you'll also need jax
and a submodule included here valjax
.
There are three sessions for the tutorial:
- Intro to Python (Python Indoctrination) —
1_basics.ipynb
: How to run and use Python. Language basics, numerical operations withnumpy
, visualization withmatplotlib
, and more. - Working with Data (How to replace Stata) —
2_data.ipynb
: Data collection and manipulation. Basic statistics withpandas
and econometrics withstatsmodels
andfastreg
. - Differentiable Programming with JAX —
3_differentiable.ipynb
: How to level up withjax
. Taking gradients withgrad
andjacobian
, auto-vectorizing withvmap
, and compiling withjit
. Extra material on looping and optimization withscan
. - Machine Learning with PyTorch —
4_machine_learning.ipynb
: Intro to machine learning methods, sort of for economists. Updated to use PyTorch!