def estimate_total_generation(df):
    """
    Estimates total energy generated from DPV in a year

    Parameters
    ----------
    df : pandas.DataFrame
        agent attributes for the given year

    Returns
    -------
    pandas.DataFrame
        agent attributes with new attributes
    """
    df['total_gen_twh'] = ((df['number_of_adopters'] - df['initial_number_of_adopters']) * df['aep'] * 1e-9) + (0.23 * 8760 * df['initial_pv_kw'] * 1e-6)
    return df