def dcf_to_swap(dcf):
    """
    Helper function transforms sorted discount factors to swap rates.

    :param dcf: discount factors
    :return: par swap rates
    """
    num_dcf = len(dcf)
    swap_rates = num_dcf * [0]
    for index, dcf_ in enumerate(dcf):
        if index == 0:
            swap_rates[index] = (1 / dcf_) - 1
        else:
            swap_rates[index] = (1 - dcf_) / sum(dcf[0:index + 1])
    return swap_rates