def get_fraction_soln(numerator_labels, numerators, denominator):
    """
    General method for calculating the proportion of a subgroup of the population in each compartment type.

    Args:
        numerator_labels: Labels of numerator compartments
        numerators: Lists of values of each numerator
        denominator: List of values for the denominator
    Returns:
        Fractions of the denominator in each numerator
    """

    # just to avoid warnings, replace any zeros in the denominators with small values
    # (numerators will still be zero, so all fractions should be zero)
    for i in range(len(denominator)):
        if denominator[i] == 0.:
            denominator[i] = 1e-3

    fraction = {}
    for label in numerator_labels:
        fraction[label] = [v / t for v, t in zip(numerators[label], denominator)]
    return fraction