def make_df(N):
    dates = pd.date_range('2000-1-1', periods=N)
states = np.arange(50)
cities = np.arange(10)
index = pd.MultiIndex.from_product([states, cities, dates], names=['State',
    'City', 'Date'])
df = pd.DataFrame(np.random.randint(10, size=(len(index), 2)), index=index,
    columns=['value_a', 'value_b'])
return df
df = make_orig()
print(using_Grouper(df))
Resampling Within a Pandas MultiIndex