title: Multiply pandas dataframe and dict after date truncation
body: <p>I have a dataframe that looks something like</p>
  
  <pre><code>import random
  import pandas as pd
  import datetime
  data = [[random.random(), random.random()] for i in range(9)]
  index = pd.date_range(start=datetime.date(2019,1,1), end=datetime.date(2019,3,5), freq='W')
  columns = ['col1', 'col2']
  df = pd.DataFrame(data, index, columns)
  </code></pre>
  
  <p>That is</p>
  
  <pre><code>                col1      col2
  2019-01-06  0.027467  0.506598
  2019-01-13  0.329616  0.558430
  2019-01-20  0.850979  0.874664
  2019-01-27  0.859704  0.168140
  2019-02-03  0.399097  0.229954
  2019-02-10  0.239516  0.626095
  2019-02-17  0.450974  0.668491
  2019-02-24  0.202464  0.434521
  2019-03-03  0.337609  0.705639
  </code></pre>
  
  <p>I also have a dictionary that looks like</p>
  
  <pre><code>multipliers = {datetime.date(2019,1, 1): 4, datetime.date(2019,2,1): 5, datetime.date(2019,3, 1): 2}
  </code></pre>
  
  <p>What I'd like to do is return a dataframe where both entries in both columns are multiplied by the value in <code>multipliers</code> that correspond to the same month.  If the dataframe had the same dates as multipliers, then I could just do <code>df.mul(multipliers, axis=0)</code>, but that's not the case here.</p>
  
  <p>What is the best way to accomplish this?  I could use a for loop and compare the dates after truncation, but that almost certainly isn't the fastest/ most efficient way to do it.</p>
  
  <hr>
  
  <p><strong>Alternatively</strong>, the multipliers could be in the form of a dataframe themselves.  An easy way to get this for my example above would be</p>
  
  <pre><code>df2 = pd.DataFrame(multipliers.values(), multipliers.keys(), columns=['mults'])
  </code></pre>
  
  <p>which would produce a dataframe that looks like</p>
  
  <pre><code>            mults
  2019-01-01    4
  2019-02-01    5
  2019-03-01    2
  </code></pre>
  
  <p>Even in this form, I'm not sure what a good way to multiply this dataframes together is.</p>