I want to create a dataframe that is grouped by region and date which shows the average age of a region during specific years. so my columns would look something like region, year, average age So far I have: # specify aggregation functions to column 'age' ageAverage = {'age':{'average age':'mean'}} # groupby and apply functions ageDataFrame = data.groupby(['Region', data.Date.dt.year]).agg(ageAverage) This works great, but how can I make it so that I only group data from specific years? say for example between 2010 and 2015? Continue reading...