title: Calculate ratio of multi groupby average to groupby average
body: <p>I want to produce a Dataframe with as many items <code>len(hr_avg)</code> and where the value of the new Dataframe is the hourly average for a month divided by the monthly average for the same month.</p>
  
  <p>The following code is sample code to produce the two data sets that will go into the final calculation. I can loop through hr_avg and calculate item by item, but would prefer a dataframe operation to do it all simultaneously if I can.</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  
  i = pd.date_range('2012-01-01 00:00', '2018-12-31 23:00', freq='H')
  x = np.random.randint(1, 100, len(i))
  
  df = pd.DataFrame(data=x, index=i)
  
  hr_avg = df.groupby([df.index.month, df.index.hour]).mean()
  mo_avg = df.groupby([df.index.month]).mean()
  </code></pre>