From 8948fff0fcf03d92b35c2a53116af1c926cb6de5 Mon Sep 17 00:00:00 2001 From: mmcky Date: Wed, 8 May 2024 14:17:32 +1000 Subject: [PATCH 1/2] [inflation_history] FIX: compat with Google Colab --- lectures/inflation_history.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lectures/inflation_history.md b/lectures/inflation_history.md index 5f840b4a4..7aa0169c2 100644 --- a/lectures/inflation_history.md +++ b/lectures/inflation_history.md @@ -23,6 +23,16 @@ The `xlrd` package is used by `pandas` to perform operations on Excel files. !pip install xlrd ``` +This lecture also requires `pandas >= 2.1.4` + +```{code-cell} ipython3 +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 From 397e5da36e0344a98afe1de52ea92b8cfdf5a1aa Mon Sep 17 00:00:00 2001 From: mmcky Date: Wed, 8 May 2024 14:41:18 +1000 Subject: [PATCH 2/2] hide output to tidy up --- lectures/inflation_history.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lectures/inflation_history.md b/lectures/inflation_history.md index 7aa0169c2..2f57c0d38 100644 --- a/lectures/inflation_history.md +++ b/lectures/inflation_history.md @@ -20,12 +20,14 @@ 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'):