Build population
Rules for building the population data by region
build_population(data_path=None)
Build the population data by region
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_path
|
PathLike
|
the path to the pop csv. Defaults to None. |
None
|
Source code in workflow/scripts/build_population.py
38 39 40 41 42 43 44 45 46 47 48 49 50 | |
load_pop_csv(csv_path)
Load the national bureau of statistics of China population (Yearbook - Population, table 2.5 pop at year end by Region)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
csv_path
|
Pathlike
|
the csv path |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: the population for constants.POP_YEAR by province |
Raises: ValueError: if the province names are not as expected
Source code in workflow/scripts/build_population.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |