def total_heat_sum_error(spf_heat_data):
    """Total values for heating and overall heating spf.

    Uses heating operational data. Calculate total heat extracted from
    ground and absolute error. Also calculates spf and fractional error.

    Parameters
    ----------
    spf_heat_data : pd.Dateframe
        Heatpump operational data during heating.

    Returns
    -------
    total_ground_heat : float
        Total heat from ground in kWh.
    total_gh_error : float
        Absolute error of total heat from ground in kWh.
    total_heat_spf : float
        Heating spf.
    ah_e_spf : float
        Heating fractional uncertainity of SPF.

    """
    # total heat from ground (kWh)
    total_ground_heat = spf_heat_data['hfg'].sum()
    # total heat from ground absolute error
    total_gh_error = spf_heat_data['E_Q'].sum()
    # heating spf for data period
    total_heat_spf = ((spf_heat_data['heat_provided'].sum())
                      / (spf_heat_data['electricity_kWh'].sum()))
    # fractional heating error
    fhe = total_gh_error/(spf_heat_data['heat_provided'].sum())
    # fractional electric error
    fee = spf_heat_data['E_w'].sum()/spf_heat_data['electricity_kWh'].sum()
    # heating fractional uncertainity of the SPF for data period
    ah_e_spf = ((fhe**2)+(fee**2))**0.5

    return total_ground_heat, total_gh_error, total_heat_spf, ah_e_spf