Python Pandas update a dataframe value from another dataframe : <p>I have two dataframes in python. I want to update rows in first dataframe using  matching values from another dataframe. Second dataframe serves as an override. </p>

<p>Here is an example with same data and code:  </p>

<p>DataFrame 1 : </p>

<p><a href="https://i.stack.imgur.com/QPJs2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/QPJs2.png" alt="enter image description here"></a></p>

<p>DataFrame 2: </p>

<p><a href="https://i.stack.imgur.com/Xbpmh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Xbpmh.png" alt="enter image description here"></a></p>

<p>I want to update update dataframe 1 based on matching code and name. In this example Dataframe 1 should be updated as below: </p>

<p><a href="https://i.stack.imgur.com/JA3Fl.png" rel="noreferrer"><img src="https://i.stack.imgur.com/JA3Fl.png" alt="enter image description here"></a></p>

<p>Note : Row with Code =2 and Name= Company2 is updated with value 1000 (coming from Dataframe 2) </p>

<pre><code>import pandas as pd

data1 = {
         'Code': [1, 2, 3],
         'Name': ['Company1', 'Company2', 'Company3'],
         'Value': [200, 300, 400],

    }
df1 = pd.DataFrame(data1, columns= ['Code','Name','Value'])

data2 = {
         'Code': [2],
         'Name': ['Company2'],
         'Value': [1000],
    }

df2 = pd.DataFrame(data2, columns= ['Code','Name','Value'])
</code></pre>

<p>Any pointers or hints? </p>
