title: Pandas: add (sum) dataframes with some different indices and columns
body: <p>I'm trying to use Pandas's capabilities to add other dataframes together as well, but the ways I'm trying to do it are not really working out. Generally, the two dataframes will have a few rows that are the same (whose values should be added), and a few rows that are different (and should be concatenated). However, the index may be different as well. As below:</p>
  
  <pre><code># dataframe 1
  pi = pd.PeriodIndex(start=2017, periods=10, freq='M')
  a = pd.Series(np.full(shape=10, fill_value=2), pi)
  b = pd.Series(np.full(shape=10, fill_value=3), pi)
  df1= pd.DataFrame({'data_1': a, 'data_2': b})
  
  # dataframe 2 to be added with longer index &amp; additional data column
  pi2 = pd.PeriodIndex(start=2016, periods=30, freq='M')
  a = pd.Series(np.full(shape=30, fill_value=2), pi2)
  b = pd.Series(np.full(shape=30, fill_value=3), pi2)
  c = pd.Series(np.full(shape=30, fill_value=3), pi2)
  df2= pd.DataFrame({'data_1': a, 'data_2': b, 'data_3': c})
  
  new_df = df1 + df2
  # returns a sum for all indices where there is a union, then nan 
  # for everything else --&gt; need to preserve values at those other locations
  # data_3 should return array/series full of 3s instead of nans
  # new_df.iloc[0,0] should return 2 instead of nan
  </code></pre>
  
  <p>I've tried a few things, but not really getting it to work as any not_null or fill_na stuff gets called after the nans are generated.</p>