title: Pandas: replace values in one dataframe with values from another dataframe based on two columns
body: <p>I have two dataframes:</p>
  
  <pre><code>d1 = {'id_': ['a','b','c','d'],
       'year':['2018','2019','2017','2019']}
  d2 = {'id_': ['a','c','e'],
       'year':['2015',NaN,'2012']}
  test1 = pd.DataFrame(d1)
  test2 = pd.DataFrame(d2)
  
  
      id_ year
  0   a   2018
  1   b   2019
  2   c   2017
  3   d   2019
  
      id_ year
  0   a   2015
  1   c   None
  2   e   2012
  </code></pre>
  
  <p>I need to replace <code>year</code> values in <code>test1</code> with <code>year</code> values from <code>test2</code> only when <code>id_</code> match. If the value is NaN, I'd like to keep the old value.</p>
  
  <pre><code>So the result looks like:
  
          id_ year
      0   a   2015
      1   b   2019
      2   c   2017
      3   d   2019
  </code></pre>
  
  <p>All answers I came across were based on index or mapping old values to new values using dictionaries.
  I will appreciate your help.</p>