title: Merge and overwrite values in pandas df
body: <p>I have two df's containing that I'm hoping to merge and overwrite specific values. Using below, <code>df1</code> and <code>df2</code> will be merged and I'm hoping to overwrite the values in <code>Group</code> for certain rows. Specifically, where <code>Group</code> is == <code>Y</code>, I want to use the values in <code>df2</code>. I've got a way but I don't think it's very efficient.</p>
  <pre><code>df1 = pd.DataFrame({      
      'Time' : [1,1,1,1,2,2,2,2,2],
      'Label' : ['A','B','C','D','A','B','C','D','E'],    
      'Group' : ['X','X','X','Y','X','Y','X','Y','X'],            
     })
  
  df2 = pd.DataFrame({  
      'Time' : [1,2,2],        
      'Label' : ['D','B','D'],  
      'Group2' : ['Y1','Y3','Y2'],                                            
      })
  
  df_out = pd.merge(df1,df2, how = 'outer')
  </code></pre>
  <p>out:</p>
  <pre><code>   Time Label Group Group2
  0     1     A     X    NaN
  1     1     B     X    NaN
  2     1     C     X    NaN
  3     1     D     Y     Y1
  4     2     A     X    NaN
  5     2     B     Y     Y3
  6     2     C     X    NaN
  7     2     D     Y     Y2
  8     2     E     X    NaN
  </code></pre>
  <p>I could then copy <code>Group2</code> to <code>Group</code> excluding the NaN values and then drop <code>Group2</code> but is there a more efficient method</p>