I think this is a basic question but I have not been able to find a usable solution yet. I have some data that is multi-index by month and year as in this attached figure
I want to do some transformations on some columns for each year and month. Let's say I have some function:
def foo(series):
return series/series.max()
So I would like to apply this function to some column (say, vol) for every month of every year, rather than for all the data at once. Can someone help?