I have a pandas DataFrame with a DatetimeIndex (1 level) and a MultiIndex columns (2 levels). I am trying to resample over the DatetimeIndex while applying different aggregation functions over different columns.
Here's a code example:
df.groupby([Grouper(freq="5Min"),
df.columns.unique(level=1)]).agg({"sub_col_0_name": "min",
"sub_col_1_name": "max",
"sub_col_2_name": "mean",
"sub_col_3_name": "std"})
I am getting the following error:
ValueError: Grouper and axis must be same length
Can someone explain me how to aggregate over the DatetimeIndex and aggregate different columns with different functions? Thank you.

