title: How to merge/join empty dataframe with another filled dataframe by equal indices and column names?
body: <p>I want to combine two <code>dataframes</code>. One <code>dataframe</code>, let's say <code>Empty_DF</code>, is empty and has big size (320 columns by 240 rows) with indexes and column names just integers. The other one,<code>ROI_DF</code>, is smaller and filled and matches at a certain location the indexes and column names. </p>
  
  <p>I have tried to use the <code>pandas.merge</code> function as it was suggested in this <a href="https://stackoverflow.com/questions/55506423/how-to-join-merge-concat-an-filled-dataframe-with-an-empty-dataframe-by-index-an">question</a>; however, it would just append the columns to the empty <code>dataframe</code> <code>Empty_DF</code> and not replacing the values. </p>
  
  <pre><code>Empty_DF = pd.DataFrame({'a':[0,0,0,0,0,0],
              'b':[0,0,0,0,0,0], 'b':[0,0,0,0,0,0]}, index=list('abcdef'))
  
  print (Empty_DF)
  
   ROI_DF= pd.DataFrame({'a':range(4),
              'b':[5,6,7,8]}, index=list('abce'))
  
   print(ROI_DF)
     a  b  c
  a  0  0  0
  b  0  0  0
  c  0  0  0
  d  0  0  0
  e  0  0  0
  f  0  0  0
  </code></pre>
  
  <p>In this example, it is sufficient since the <code>dataframe</code> is small and the <code>pandas.fillna</code> option with pandas.drop can be used. Is there a more efficient way of optimizing this to bigger <code>dataframes</code>? </p>
  
  <pre><code>df3 = pd.merge(Empty_DF, ROI_DF, how='left', left_index=True, 
  right_index=True, suffixes=('_x', ''))
  df3['a'].fillna(df3['a_x'], inplace=True)
  df3['b'].fillna(df3['b_x'], inplace=True)
  df3.drop(['a_x', 'b_x'], axis=1, inplace=True)
  
  print(df3)
   a  b c
  a  0  5 0
  b  1  6 0
  c  2  7 0
  d  0  0 0
  e  3  8 0
  f  0  0 0
  </code></pre>