# 9.35:  Group the data by month or quarter.  Add a column representing the period, then group by
# that column and compute the mean.

df['month'] = df.index.to_period('M')

# monthly_grouped = df.groupby('month')['close'].mean()

# monthly_grouped


# df['quarter'] = df.index.to_period('Q')
# quarterly_grouped = df.groupby('quarter')['close'].mean()

# quarterly_grouped

