diff --git a/etl/steps/data/garden/demography/2024-12-06/shared.py b/etl/steps/data/garden/demography/2024-12-06/shared.py index dfe71a1b15e..97496624806 100644 --- a/etl/steps/data/garden/demography/2024-12-06/shared.py +++ b/etl/steps/data/garden/demography/2024-12-06/shared.py @@ -136,3 +136,12 @@ def add_dim_some_education(tb): def get_index_columns(tb): cols_index = list(tb.columns.intersection(COLUMNS_INDEX)) return cols_index + + +def add_prop(tb): + # Add + tbx = tb[tb["education"] == "total"].drop(columns=["education", "assr"]) + tb_sex_age_edu = tb.merge(tbx, on=["country", "year", "age", "sex", "scenario"], suffixes=["", "_total"]) + tb_sex_age_edu["prop"] = 100 * tb_sex_age_edu["pop"] / tb_sex_age_edu["pop_total"] + + return tb diff --git a/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital.meta.yml b/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital.meta.yml index 5e2cb8bdf66..f886cbc03b4 100644 --- a/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital.meta.yml +++ b/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital.meta.yml @@ -523,6 +523,8 @@ tables: with <%- if (education == "no_education") %>no education<%- elif (education == "some_education") %>some formal education<%- else %><> education<%- endif %> <%- endif %> in a country or region. + description_processing: |- + We have estimated this indicator with the population values from this source. presentation: topic_tags: - Global Education diff --git a/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_historical.meta.yml b/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_historical.meta.yml index 1406e43dacd..fbddd08a368 100644 --- a/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_historical.meta.yml +++ b/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_historical.meta.yml @@ -494,6 +494,8 @@ tables: with <%- if (education == "no_education") %>no education<%- if (education == "some_education") %>some formal education<%- else %><> education<%- endif %> <%- endif %> in a country or region. + description_processing: |- + We have estimated this indicator with the population values from this source. presentation: topic_tags: - Global Education diff --git a/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_historical.py b/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_historical.py index 3c307711ce7..98b06d87181 100644 --- a/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_historical.py +++ b/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_historical.py @@ -2,7 +2,7 @@ from etl.helpers import PathFinder, create_dataset -from .shared import add_dim_some_education, make_table +from .shared import add_dim_some_education, add_prop, make_table # Get paths and naming conventions for current step. paths = PathFinder(__file__) @@ -96,7 +96,7 @@ def run(dest_dir: str) -> None: "age": "category", "education": "category", }, - cols_single=["pop", "prop"], + cols_single=["pop"], cols_range=["assr"], per_1000=["pop"], per_100=["assr"], @@ -105,6 +105,9 @@ def run(dest_dir: str) -> None: # Add education="some_education" (only for sex=total and age=total, and indicator 'pop') tb_sex_age_edu = add_dim_some_education(tb_sex_age_edu) + # Add population share + tb_sex_age_edu = add_prop(tb_sex_age_edu) + # # Save outputs. # diff --git a/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_proj.meta.yml b/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_proj.meta.yml index 434bd3d3063..02a41a28d00 100644 --- a/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_proj.meta.yml +++ b/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_proj.meta.yml @@ -558,6 +558,8 @@ tables: with <%- if (education == "no_education") %>no education<%- elif (education == "some_education") %>some formal education<%- else %><> education<%- endif %> <%- endif %> in a country or region. + description_processing: |- + We have estimated this indicator with the population values from this source. presentation: topic_tags: - Global Education diff --git a/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_proj.py b/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_proj.py index ed3ce486744..3fe57a84e89 100644 --- a/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_proj.py +++ b/etl/steps/data/garden/demography/2024-12-06/wittgenstein_human_capital_proj.py @@ -2,7 +2,7 @@ from etl.helpers import PathFinder, create_dataset -from .shared import add_dim_some_education, make_table +from .shared import add_dim_some_education, add_prop, make_table # Get paths and naming conventions for current step. paths = PathFinder(__file__) @@ -96,7 +96,7 @@ def run(dest_dir: str) -> None: "age": "category", "education": "category", }, - cols_single=["pop", "prop"], + cols_single=["pop"], cols_range=["assr"], per_1000=["pop"], per_100=["assr"], @@ -105,6 +105,9 @@ def run(dest_dir: str) -> None: # Add education="some_education" (only for sex=total and age=total, and indicator 'pop') tb_sex_age_edu = add_dim_some_education(tb_sex_age_edu) + # Add population share + tb_sex_age_edu = add_prop(tb_sex_age_edu) + # # Save outputs. # diff --git a/etl/steps/data/meadow/demography/2024-12-06/wittgenstein_human_capital_historical.py b/etl/steps/data/meadow/demography/2024-12-06/wittgenstein_human_capital_historical.py index fa03d99d54d..476f1d5b57b 100644 --- a/etl/steps/data/meadow/demography/2024-12-06/wittgenstein_human_capital_historical.py +++ b/etl/steps/data/meadow/demography/2024-12-06/wittgenstein_human_capital_historical.py @@ -49,7 +49,7 @@ ] TABLES_CONCAT = [ - ("prop", "bprop"), + # ("prop", "bprop"), ("mys", "bmys"), ] TABLES_DROP = [] @@ -69,7 +69,7 @@ # 2/ Age+Education dimensions. NOTE: no age=total, that's fine. We have tfr for all ages actually. "by_age_edu": {"asfr"}, # 3/ Sex+Age+Education dimensions - "by_sex_age_edu": {"assr", "pop", "prop"}, + "by_sex_age_edu": {"assr", "pop"}, } diff --git a/etl/steps/data/meadow/demography/2024-12-06/wittgenstein_human_capital_proj.py b/etl/steps/data/meadow/demography/2024-12-06/wittgenstein_human_capital_proj.py index 302dbf1ec85..b06249c6e94 100644 --- a/etl/steps/data/meadow/demography/2024-12-06/wittgenstein_human_capital_proj.py +++ b/etl/steps/data/meadow/demography/2024-12-06/wittgenstein_human_capital_proj.py @@ -52,7 +52,7 @@ ] TABLES_CONCAT = [ - ("prop", "bprop"), + # ("prop", "bprop"), ("mys", "bmys"), ] TABLES_DROP = [ @@ -81,7 +81,7 @@ # 2/ Age+Education dimensions. NOTE: no age=total, that's fine. We have tfr for all ages actually. "by_age_edu": {"asfr"}, # 3/ Sex+Age+Education dimensions - "by_sex_age_edu": {"assr", "pop", "prop"}, + "by_sex_age_edu": {"assr", "pop"}, }