diff --git a/etl/steps/data/garden/demography/2024-12-02/survivor_percentiles.meta.yml b/etl/steps/data/garden/demography/2024-12-02/survivor_percentiles.meta.yml index 9c06c6ce986..07e19bde3f9 100644 --- a/etl/steps/data/garden/demography/2024-12-02/survivor_percentiles.meta.yml +++ b/etl/steps/data/garden/demography/2024-12-02/survivor_percentiles.meta.yml @@ -41,4 +41,4 @@ tables: numDecimalPlaces: 1 presentation: attribution: |- - Alvarez & Vaupel (2023); Human Mortality Database (2023) + Alvarez & Vaupel (2023); Human Mortality Database (2024) diff --git a/etl/steps/data/garden/demography/2024-12-02/survivor_percentiles.py b/etl/steps/data/garden/demography/2024-12-02/survivor_percentiles.py index c1b4ab4d326..1f2b1ef59cc 100644 --- a/etl/steps/data/garden/demography/2024-12-02/survivor_percentiles.py +++ b/etl/steps/data/garden/demography/2024-12-02/survivor_percentiles.py @@ -39,11 +39,11 @@ def run(dest_dir: str) -> None: # # Combine tables, drop NaNs tb = tb_deaths.merge(tb_exposure, on=["country", "year", "sex", "age"], how="outer") - tb = tb.dropna(subset=["deaths", "exposure"], how="all") + tb = tb.dropna(subset=["deaths", "exposure"], how="any") # Keep format="1x1", and sex="both" paths.log.info("keep period & 1-year data.") - tb = tb.loc[tb["age"].str.match(r"^\d{3}\+?$") & (tb["type"] == "period")] + tb = tb.loc[tb["age"].str.match(r"^(\d{1,3}|d{3}\+)$") & (tb["type"] == "period")] # Drop unused columns tb = tb.drop(columns=["type"])