Skip to content

Commit ebff90f

Browse files
jstacclaude
andauthored
prob_dist: read the Japan population data from data-lectures (#821)
Repoints the last dataset that #790 committed into this repo. The workbook under _static/ is deleted; the lecture now reads the CSV published at QuantEcon/data-lectures#33. The cell also gets easier to read. It was url = '_static/lecture_specific/prob_dist/japan_population_by_age.xlsx' data = pd.read_excel(url, sheet_name='第1表', header=None, skiprows=10, usecols=[14], names=['population'], nrows=101) with a comment explaining what column 14 held, because the file was an on-demand e-Stat export laid out for printing. The replacement was rebuilt from the Statistics Bureau original by a committed builder, so the lecture selects named columns instead. The figures are identical: the published data are the same, value for value, which was verified before the CSV was written. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent a453cf5 commit ebff90f

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

Binary file not shown.

lectures/prob_dist.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,11 @@ mystnb:
127127
name: fig:japan-age
128128
tags: [hide-input]
129129
---
130-
# Data file is stored in this repo for now; switch to the QuantEcon/datasets
131-
# URL once that repo exists (see QuantEcon/meta#336).
132-
url = '_static/lecture_specific/prob_dist/japan_population_by_age.xlsx'
133-
# Column 14 holds the Japanese-national population (in thousands) by single year
134-
# of age; rows run from age 0 to "100 and over".
135-
data = pd.read_excel(url, sheet_name='第1表', header=None, skiprows=10,
136-
usecols=[14], names=['population'], nrows=101)
137-
population = data['population'].to_numpy()
138-
age = np.arange(101) # 0, 1, ..., 100, where 100 means "100 and over"
130+
url = ('https://github.com/QuantEcon/data-lectures/raw/main/'
131+
'lectures/japan_population_by_age.csv')
132+
data = pd.read_csv(url)
133+
age = data['age'] # 0, 1, ..., 100 and over
134+
population = data['japanese_population'] # in thousands
139135
140136
p = population / population.sum()
141137

0 commit comments

Comments
 (0)