Pre-process

Overview:

class epios.DataProcess(data: DataFrame, path: str = './input/', num_age_group=None, age_group_width=None, mode=None)[source]

Can process data depending on different modes of samplers.

When defining an instance, the pre_process part would automatically run.

This is the base class for different samplers.

Parameters:

pathstr

The path to store the processed data

datapandas.DataFrame

The dataframe containing geographical data

num_age_groupint

This will be used when age stratification is enabled, indicating how many age groups are there.

The last group includes age >= some threshold

age_group_widthint

This will be used when age stratification is enabled indicating the width of each age group (except for the last group)

modestr

This indicates the specific mode to process the data This should be the name of the modes that can be identified

Attributes:

gen_ageinfobool

Whether generating age information

gen_geoinfobool

Whether generating demographical information

datapandas.DataFrame

The demographical data from EpiABM

pre_process(path='./input/', num_age_group=None, age_group_width=None)[source]

Take the geographical DataFrame then convert the data into files that Sampler classes can use

Parameters:

(See explanation for the class above)

Output:

Will write three files (depending on the mode of processing chosen) into the given path.

The first one is data.csv, contains the data for each person.

The second one is microcells.csv, contains the geographical information.

The third one is pop_dist.json, contains a list of age distribution across the population.