title: Python: how to find values in another dataframe?
body: <p>I have two DataFrames, <code>df1</code>: </p>
  
  <pre><code>df1.head(6)
               t day  node    s   e   i   r   sm  em  im
      491325  100 0   0       9   12  21  95  2   4   17
      491326  100 0   1       8   16  17  140 7   5   40
      491327  100 0   2       8   9   17  143 0   4   38
      491328  100 0   3      20   15  37  259 4   7   60
      491329  100 0   4       8   13  11  85  1   1   20
      491330  100 0   5       0   4   6   37  0   0   10
  </code></pre>
  
  <p>and <code>df2</code>:</p>
  
  <pre><code>df2.head(6)
     node original     lat        lon     r
  0   0   50405      1.299033 103.83828   0
  1   1   50404      1.299033 103.83828   0
  2   2   50405      1.299033 103.83828   0
  3   3   50402      1.299033 103.83828   0
  4   4   6101       1.299033 103.83828   0
  5   5   9821       1.332867 103.95767   0
  </code></pre>
  
  <p>I want to update <code>df2.r</code> based on <code>df1.r</code> and I am doing a loop:</p>
  
  <pre><code>for j in df1.index:
      tmp = df2[df2.node == df1.node[j]]
      df2.r[tmp.index[0] = df1.r[j]
  </code></pre>
  
  <p>Is there a better way to merge the two DataFrames?</p>