Skip to content

Wave

Wave

Wave(year: str, wave_folder: str, country: Country)

A single survey wave within a country.

Typically obtained via bracket notation on a :class:Country::

wave = uga['2019-20']
df = wave.household_roster()

Parameters:

Name Type Description Default
year str

Wave label (e.g. '2019-20').

required
wave_folder str

Subdirectory name on disk (may differ from year for multi-round surveys).

required
country Country

Parent country instance.

required

data_scheme property

data_scheme: list[str]

resources property

resources: dict[str, Any]

Load the data_info.yml that describes table structure, merges, etc.

formatting_functions property

formatting_functions: dict[str, Callable[..., Any]]

column_mapping

column_mapping(request: str, data_info: dict[str, Any] | None = None) -> dict[str, Any]

Retrieve column mappings for a given dataset request and map into a dictionary to be ready for df_data_grabber.

Input: request: str, the request data name in data_scheme (e.g. 'cluster_features', 'household_roster', 'food_acquired', 'interview_date')

Output: final_mapping: dict, {file_name: {'idxvars': idxvar_dic, 'myvars': myvars_dic}}

Example: {'data_file.dta': {'idxvars': {'cluster': ('cluster', )}), 'myvars': {'region': ('region', ), 'urban': ('urban', )}}}

grab_data

grab_data(request: str) -> pd.DataFrame

get data from the data file Input: request: str, the request data name (e.g. 'cluster_features', 'household_roster', 'food_acquired', 'interview_date') Output: df: pd.DataFrame, the data requested