def question_3(df):
    """
    This functions determines the average Medicare payments per DRG per
    facility.

    Parameters
    ------------
    df : `pandas.DataFrame`
        DataFrame containing the original information about DRG.

    Returns
    --------
    medicare_pd : `pandas.DataFrame`
        DataFrame containing information about the average Medicare
        payments per DRG per facility
    """
    # Columns to keep
    disch_col = 'total_discharges'
    prov_col  = 'provider_name'
    drg_col   = 'drg_definition'
    medi_col  = 'average_medicare_payments'
    cols_keep = [prov_col, disch_col, drg_col, medi_col]
    # Creating sub-DataFrame
    med_main_df = df.loc[:, cols_keep]
    # Grouping by DRG and facility
    medicare_pd = (med_main_df.groupby([drg_col, prov_col])
                    .mean()).drop(disch_col, axis=1)

    return medicare_pd