title: How do I update the target DataFrame with values from source DataFrame that meet the condition?
body: <p>This is my source DataFrame</p>
  <pre><code>df = pd.DataFrame({'uid': [1, 2, 3, 5, 6],
      'grades': [69.233627, 70.130900, 83.357011, 88.206387, 74.342212]})
  </code></pre>
  <p>This is my target DataFrame</p>
  <pre><code>df2 = pd.DataFrame({'uid': [1, 2, 9],
                      'grades': [0.0,0.0,0.0]})
  </code></pre>
  <p>I'm trying to update the target DataFrame with values from source DataFrame that meet the condition.</p>
  <pre><code>for i in df2['uid']:
      if (len(df[df['uid']==i])&gt;0):
          df2.loc[df2['uid']==i, 'grades']=df.loc[df['uid']==i, 'grades']
  </code></pre>
  <p>I've got what I need</p>
  <pre><code>&gt;&gt;&gt; df2
  uid grades
  0   1   69.233627
  1   2   70.130900
  2   9   0.000000
  </code></pre>
  <p>I'd just like to know is there a simpler way to do the job?</p>