From c82a43b4cb4792a53b553788e8e28e8f05625ee5 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Wed, 12 Aug 2026 10:30:29 +1000 Subject: [PATCH] Read life-expectancy and usa-gini from data-lectures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wave A4 of the datasets migration: the last two Track A CSVs moved to QuantEcon/data-lectures in QuantEcon/data-lectures#74, which is on `main` and serving both files. Three URLs. All three land on `raw.githubusercontent.com` — one spelling for reads and downloads alike, matching the decision taken during the high_dim_data fold. It drops a redirect hop and avoids the two-hosts-in-one-file split that the "harmonise these forms" class of fix has broken before. Note this differs from the older `github.com/.../raw/` form used by earlier repoint sets in this repo; harmonising those is a separate sweep, not this PR. Left alone on purpose: simple_linear_regression.md `cols = [... 'Life expectancy at birth (historical)' ...]`. The migrated bytes are byte-identical to intro's, so the old column label is still correct. Upstream OWID has since renamed four of eight columns and halved the row count; that delta is recorded in the new manifest and registered on QuantEcon/data-lectures#39. Adopting it is a content change, not a repoint. inequality.md the `[This notebook]` link to intro's `_static/.../data.ipynb`. It points at a notebook, not a dataset, and that notebook stays in lecture-python-intro. Verified rather than assumed. Line numbers re-derived immediately before editing. Both targets serve 200 with `access-control-allow-origin: *` and sha256 matching the manifests (ec5d3235… / bed9074a…). Old and new URLs produce IDENTICAL frames under the lecture's own code: both read_csv calls in simple_linear_regression (10x8 and 62156x4), `.dropna()` at 12,445 rows — which is what the prose asserts — the `Year == 2018` filter at 166 rows that drives the fitted scatter, and inequality's 20x3 with an identical index. So this cannot change a figure. Intro KEEPS both committed copies. Deleting them is phase 2 and is gated on this repo publishing AND on lecture-intro.zh-cn and test-actions-lecture-intro republishing — merging a repoint changes main, not a tag-gated published site. That gap is what QuantEcon/workspace-lectures#28 recorded. --- lectures/inequality.md | 2 +- lectures/simple_linear_regression.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lectures/inequality.md b/lectures/inequality.md index d066b7ab..0b649cbd 100644 --- a/lectures/inequality.md +++ b/lectures/inequality.md @@ -618,7 +618,7 @@ df_income_wealth.year.describe() [This notebook](https://github.com/QuantEcon/lecture-python-intro/tree/main/lectures/_static/lecture_specific/inequality/data.ipynb) can be used to compute this information over the full dataset. ```{code-cell} ipython3 -data_url = 'https://github.com/QuantEcon/lecture-python-intro/raw/main/lectures/_static/lecture_specific/inequality/usa-gini-nwealth-tincome-lincome.csv' +data_url = 'https://raw.githubusercontent.com/QuantEcon/data-lectures/main/lectures/usa-gini-nwealth-tincome-lincome.csv' ginis = pd.read_csv(data_url, index_col='year') ginis.head(n=5) ``` diff --git a/lectures/simple_linear_regression.md b/lectures/simple_linear_regression.md index a2a8132c..d8962d6a 100644 --- a/lectures/simple_linear_regression.md +++ b/lectures/simple_linear_regression.md @@ -408,12 +408,12 @@ Let's consider two economic variables GDP per capita and Life Expectancy. ::: -You can download {download}`a copy of the data here ` if you get stuck +You can download {download}`a copy of the data here ` if you get stuck **Q3:** Use `pandas` to import the `csv` formatted data and plot a few different countries of interest ```{code-cell} ipython3 -data_url = "https://github.com/QuantEcon/lecture-python-intro/raw/main/lectures/_static/lecture_specific/simple_linear_regression/life-expectancy-vs-gdp-per-capita.csv" +data_url = "https://raw.githubusercontent.com/QuantEcon/data-lectures/main/lectures/life-expectancy-vs-gdp-per-capita.csv" df = pd.read_csv(data_url, nrows=10) ```