From 1d2633de509e2d3689312f8fd8baff4f434e5cbb Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Thu, 9 May 2024 14:57:30 +1000 Subject: [PATCH] [inflation_history] FIX: compat with Google Colab (#439) * [inflation_history] FIX: compat with Google Colab * hide output to tidy up --- lectures/inflation_history.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lectures/inflation_history.md b/lectures/inflation_history.md index 5f840b4a..2f57c0d3 100644 --- a/lectures/inflation_history.md +++ b/lectures/inflation_history.md @@ -20,9 +20,21 @@ Let's start by installing the necessary Python packages. The `xlrd` package is used by `pandas` to perform operations on Excel files. ```{code-cell} ipython3 +:tags: [hide-output] !pip install xlrd ``` +This lecture also requires `pandas >= 2.1.4` + +```{code-cell} ipython3 +:tags: [hide-output] +from packaging.version import Version +import pandas as pd +if Version(pd.__version__) < Version('2.1.4'): + !pip install pandas==2.1.4 + reload(pandas) +``` + We can then import the Python modules we will use. ```{code-cell} ipython3