API Reference¶
Main Functions¶
The lost_years package provides three main functions for calculating expected years of life lost:
lost_years_ssa¶
- lost_years.lost_years_ssa(df, cols=None)¶
Appends Life expectancycolumn from SSA data to the input DataFrame based on age, sex and year in the specific cols mapping
- Parameters:
- Returns:
‘ssa_age’, ‘ssa_year’, ‘ssa_life_expectancy’
- Return type:
Pandas DataFrame with life expectancy columns
lost_years_hld¶
- lost_years.lost_years_hld(df, cols=None)¶
Appends Life expectancy column from HLD data to the input DataFrame based on country, age, sex and year in the specific cols mapping.
- Parameters:
- Returns:
‘hld_country’, ‘hld_age’, ‘hld_sex’, ‘hld_year’, ‘hld_life_expectancy’.
- Return type:
Pandas DataFrame with HLD data columns
lost_years_who¶
- lost_years.lost_years_who(df, cols=None)¶
Appends Life expectancy column from WHO data to the input DataFrame based on country, age, sex and year in the specific cols mapping.
- Parameters:
- Returns:
‘who_country’, ‘who_age’, ‘who_sex’, ‘who_year’, …
- Return type:
Pandas DataFrame with WHO data columns
Module Details¶
SSA Module¶
HLD Module¶
HLD (Human Life-Table Database) module for lost_years package.
Provides access to historical life table data from lifetable.de covering 142 countries from 1751-2023.