title: Python Pandas: update dataframe values from another dataframe
body: <p>I have these two dataframes:  (<strong>update:</strong> I've added one column <code>stuff</code>to <code>df1</code> to specify that the two dataframes have not the same schemas)</p>
  
  <pre><code>df1 = pd.DataFrame({'id': ['1','2','3'], 
                      'val': [0, 0, 0], 
                      'stuff': ['foo', 'bar', 'spam']})
  df2 = pd.DataFrame({'id': ['2','3'], 'val': [10, 20]})
  
  print(df1)
    id  val stuff
  0  1    0   foo
  1  2    0   bar
  2  3    0  spam
  
  print(df2)
    id  val
  0  2   10
  1  3   20
  </code></pre>
  
  <p>I want to update the values in <code>df1</code> <code>val</code> column with the values from <code>df2</code> <code>val</code> column based on the <code>id</code> column. Desired result after transformation on <code>df1</code>:</p>
  
  <pre><code>print(df1)
    id  val stuff
  0  1    0   foo
  1  2   10   bar
  2  3   20  spam
  </code></pre>
  
  <p>I could use a join (<code>merge</code>) but then I would need several more steps to end up with the expected result (casting the column from float to int, dropping column, etc.). (BTW, if you have a simple and elegant way to it with a join, I am also interested).<br>
  I am trying to use slicing methods but could not figure out how. Example:</p>
  
  <pre><code>&gt;&gt;&gt; df1.loc[df1['id'].isin(df2['id']), 'val'] = df2['val']
  </code></pre>
  
  <p>gives:</p>
  
  <pre><code>print(df1)
    id   val stuff
  0  1   0.0   foo
  1  2  20.0   bar
  2  3   NaN  spam
  </code></pre>
  
  <p><strike><strong>Update:</strong> One more constraint: do not modify the original <code>df1</code> index.</strike> </p>