I'm trying to group an xarray.Dataset object into a custom 5-month period spanning from October-January with an annual frequency. This is complicated because the period crosses New Year. I've been trying to use the approach wb_start = temperature.sel(time=temperature.time.dt.month.isin([10,11,12,1])) wb_start1 = wb_start.groupby('time.year') But this predictably makes the January month of the same year, instead of +1 year. Any help would be appreciated! Continue reading...