Skip to content

Commit a09db42

Browse files
authored
Read life-expectancy and usa-gini from data-lectures (#834)
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.
1 parent 77e553a commit a09db42

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎lectures/inequality.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ df_income_wealth.year.describe()
618618
[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.
619619

620620
```{code-cell} ipython3
621-
data_url = 'https://github.com/QuantEcon/lecture-python-intro/raw/main/lectures/_static/lecture_specific/inequality/usa-gini-nwealth-tincome-lincome.csv'
621+
data_url = 'https://raw.githubusercontent.com/QuantEcon/data-lectures/main/lectures/usa-gini-nwealth-tincome-lincome.csv'
622622
ginis = pd.read_csv(data_url, index_col='year')
623623
ginis.head(n=5)
624624
```

‎lectures/simple_linear_regression.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,12 @@ Let's consider two economic variables GDP per capita and Life Expectancy.
408408
<iframe src="https://ourworldindata.org/grapher/life-expectancy-vs-gdp-per-capita" loading="lazy" style="width: 100%; height: 600px; border: 0px none;"></iframe>
409409
:::
410410
411-
You can download {download}`a copy of the data here <https://github.com/QuantEcon/lecture-python-intro/raw/main/lectures/_static/lecture_specific/simple_linear_regression/life-expectancy-vs-gdp-per-capita.csv>` if you get stuck
411+
You can download {download}`a copy of the data here <https://raw.githubusercontent.com/QuantEcon/data-lectures/main/lectures/life-expectancy-vs-gdp-per-capita.csv>` if you get stuck
412412
413413
**Q3:** Use `pandas` to import the `csv` formatted data and plot a few different countries of interest
414414
415415
```{code-cell} ipython3
416-
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"
416+
data_url = "https://raw.githubusercontent.com/QuantEcon/data-lectures/main/lectures/life-expectancy-vs-gdp-per-capita.csv"
417417
df = pd.read_csv(data_url, nrows=10)
418418
```
419419

0 commit comments

Comments
 (0)