def wrangle_counties(df):
    """
    Wrangle the data to group by county.

    Parameters:
    -----------
    df -- (pandas DataFrame) Cleaned data in a dataframe.

    Returns the data grouped by county in a pandas df.
    """
    # Group and aggregate the data by Counties
    counties_grouped = df.groupby(['county', 'county_id'], as_index=False)
    wine_counties = counties_grouped.agg({'points': ['mean'],
                                          'price': ['mean'],
                                          'value_scaled': ['mean'],
                                          'description': ['count']})

    wine_counties.columns = wine_counties.columns.droplevel(level=1)
    wine_counties = wine_counties.rename(columns={"county": 'County',
                                                  "county_id": 'County ID',
                                                  "description": "Num Reviews",
                                                  "points": 'Ave Rating',
                                                  "price": 'Ave Price',
                                                  "value_scaled": 'Ave Value'})

    return wine_counties