hiv_workflow.lib.analysis.population_obs module

class hiv_workflow.lib.analysis.population_obs.PopulationObs(filename=None, dataframe=None, stratifiers=None)

Bases: hiv_workflow.lib.analysis.data_frame_wrapper.DataFrameWrapper

PROVINCIAL = 'Provincial'
NON_PROVINCIAL = 'Non-provincial'
AGGREGATED_NODE = 0
AGGREGATED_PROVINCE = 'All'
WEIGHT_CHANNEL = 'weight'
fix_age_bins()

A method that converts the ‘, ‘ separated AgeBin format: [X, Y) to the new ‘:’ format: [X:Y) for back-compatibility. :return: nothing

get_age_bins()
get_provinces()
get_genders()
get_years()
adjust_years(exclude_channels=None)
add_percentile_values(channel, distribution, p)

Computes the inverse beta distribution of ‘value’ at the specified probability threshold. :param channel: the channel/column with beta distribution parameters to compute percentiles with. :param p: probability threshold, float, 0-1 :return: a list of the newly added (single) channel. Adds the column e.g. <channel>–Beta-0.025 (for 2.5000% threshold) for the designated threshold.

find_missing_tuples(target: object, value_column_base: str, value_column_target: str = None) → Optional[List[tuple]]

Finds the missing tuples in the target based on the startifiers and a column containing value. :param target: The target PopulationObs in which to check :param value_column_base: the column containing value in the current object :param value_column_target: the column containing a value in the target

Returns: list of missing tuples for the value_column None if nothing is missing