memilio.epidata.getContactData
getContactData.py
Load an age-structured contact matrix for a chosen country based on
Prem et al., 2017 (DOI: https://doi.org/10.1371/journal.pcbi.1005697).
The module can download the supporting ZIP from
https://doi.org/10.1371/journal.pcbi.1005697.s002 (contains the
MUestimates_all_locations_1.xlsx workbook) or read a defined local
workbook path. By default, downloads are done in memory and no
files are written.
Functions
|
List all country names available in the contact matrix workbook. |
|
Load the all-locations contact matrix for the given country. |
- memilio.epidata.getContactData.list_available_contact_countries( )
List all country names available in the contact matrix workbook.
- Parameters:
contact_path – Optional local path to the workbook.
- Returns:
List of all country names.
- memilio.epidata.getContactData.load_contact_matrix(
- country: str,
- contact_path: str | None = None,
- reduce_to_rki_groups: bool = True,
- population: Iterable[float] | None = None,
Load the all-locations contact matrix for the given country. If
contact_pathis not provided, the function downloads theMUestimates_all_locations_1.xlsxworkbook from Prem et al., 2017.- Parameters:
country – Country name as listed in the workbook (case-insensitive).
contact_path – Optional path to
MUestimates_all_locations_1.xlsx.reduce_to_rki_groups – If True, aggregate to the six RKI age groups (0-4, 5-14, 15-34, 35-59, 60-79, 80+ years). Default True.
population – An iterable of 16 float values representing the population size for each original age group. Required if reduce_to_rki_groups is True.
- Returns:
DataFrame indexed by age group with floats.