def zero_to_dcf(zero_rates):
    """
    Helper function transforms sorted zero rates to discount factors.

    :param zero_rates: zero rates
    :return: discount factors
    """
    num_rates = len(zero_rates)
    dcf = num_rates * [0]
    for index, rate in enumerate(zero_rates):
        time_to_maturity = index + 1
        dcf[index] = 1 / (1 + rate) ** time_to_maturity
    return dcf