def select_daily_mean(daily_mean, gw_data):
    """
    Select the lakes in the daily_mean file that are retained in the final growth window.
    Input:
        daily_mean: dataframe with all compiled daily mean water quality data
        gw_data: growth window dataframe (output from the growth_window_means function)
    Output:
        selected_daily_mean: Dataframe of daily mean data for all lakes within the growth window dataset
    """

    final_lakes_list = gw_data.lake.unique()
    boolean_series = daily_mean.lake.isin(final_lakes_list)
    selected_daily_mean = daily_mean[boolean_series]

    return selected_daily_mean