title: Multiply filtered rows by constant in pandas
body: <p>I checked <a href="https://stackoverflow.com/questions/33768122/python-pandas-dataframe-how-to-multiply-entire-column-with-a-scalar">this answer</a> but it only applies to entire columns.</p>
  
  <p>I have a dataframe with 3 columns (name, date, value)</p>
  
  <pre><code>     Name         Dt    Value
  0    aaaa 2018-01-01      100
  1    bbbb 2018-07-02      200
  2    aaaa 2019-01-01      300
  3    aaaa 2020-01-04      500
  </code></pre>
  
  <p>I also have a dictionary of yearly scale factors. what i want to do is to multiply all value in a year by the corresponding scale factor.</p>
  
  <p>I tried doing something like this</p>
  
  <pre><code>df[df['Name'] == a &amp; df['Dt'].dt.year == i]['Value'] *= dictionary[i]
  </code></pre>
  
  <p>this doesn't seem to be working. is there a way to do this without looping through every row?</p>