import pandas as pd


df = pd.read_csv('data_out.csv')

df_1990s = df[(df.year >= 1980) & (df.year <= 2009)].groupby(['tmax_window', 'wind_thld', 'tmax_thld', 'gcm', 'lat', 'lon']).mean().reset_index()
df_2030s = df[(df.year >= 2020) & (df.year <= 2049)].groupby(['tmax_window', 'wind_thld', 'tmax_thld', 'gcm', 'lat', 'lon']).mean().reset_index()
df_2050s = df[(df.year >= 2040) & (df.year <= 2069)].groupby(['tmax_window', 'wind_thld', 'tmax_thld', 'gcm', 'lat', 'lon']).mean().reset_index()
df_2080s = df[(df.year >= 2070) & (df.year <= 2099)].groupby(['tmax_window', 'wind_thld', 'tmax_thld', 'gcm', 'lat', 'lon']).mean().reset_index()

df_1990s['period'] = '1990s'
df_2030s['period'] = '2030s'
df_2050s['period'] = '2050s'
df_2080s['period'] = '2080s'
