title: Setting DataFrame values with enlargement
body: <p>I have two <code>DataFrames</code> (with <code>DatetimeIndex</code>) and want to update the first frame (the older one) with data from the second frame (the newer one). </p>
  
  <p>The new frame may contain more recent data for rows already contained in the the old frame. In this case, data in the old frame should be overwritten with data from the new frame. 
  Also the newer frame may have more columns / rows, than the first one.
  In this case the old frame should be enlarged by the data in the new frame.</p>
  
  <p>Pandas <a href="http://pandas.pydata.org/pandas-docs/stable/indexing.html#setting-with-enlargement" rel="noreferrer">docs</a> state, that </p>
  
  <p>"The <code>.loc/.ix/[]</code> operations can perform enlargement when setting a non-existant key for that axis" </p>
  
  <p>and </p>
  
  <p>"a DataFrame can be enlarged on either axis via <code>.loc</code>"</p>
  
  <p>However this doesn't seem to work and throws a <code>KeyError</code>. Example:</p>
  
  <pre><code>In [195]: df1
  Out[195]: 
                       A  B  C
  2015-07-09 12:00:00  1  1  1
  2015-07-09 13:00:00  1  1  1
  2015-07-09 14:00:00  1  1  1
  2015-07-09 15:00:00  1  1  1
  
  In [196]: df2
  Out[196]: 
                       A  B  C  D
  2015-07-09 14:00:00  2  2  2  2
  2015-07-09 15:00:00  2  2  2  2
  2015-07-09 16:00:00  2  2  2  2
  2015-07-09 17:00:00  2  2  2  2
  
  In [197]: df1.loc[df2.index] = df2
  ---------------------------------------------------------------------------
  KeyError                                  Traceback (most recent call last)
  &lt;ipython-input-197-74e630e87cf8&gt; in &lt;module&gt;()
  ----&gt; 1 df1.loc[df2.index] = df2
  
  /.../pandas/core/indexing.pyc in __setitem__(self, key, value)
      112 
      113     def __setitem__(self, key, value):
  --&gt; 114         indexer = self._get_setitem_indexer(key)
      115         self._setitem_with_indexer(indexer, value)
      116 
  
  /.../pandas/core/indexing.pyc in _get_setitem_indexer(self, key)
      107 
      108         try:
  --&gt; 109             return self._convert_to_indexer(key, is_setter=True)
      110         except TypeError:
      111             raise IndexingError(key)
  
  /.../pandas/core/indexing.pyc in _convert_to_indexer(self, obj, axis, is_setter)
     1110                 mask = check == -1
     1111                 if mask.any():
  -&gt; 1112                     raise KeyError('%s not in index' % objarr[mask])
     1113 
     1114                 return _values_from_object(indexer)
  
  KeyError: "['2015-07-09T18:00:00.000000000+0200' '2015-07-09T19:00:00.000000000+0200'] not in index"
  </code></pre>
  
  <p>What is the best way (with respect to performance, as my real data is much larger) two achieve the desired updated and enlarged DataFrame. This is the result I would like to see:</p>
  
  <pre><code>                     A  B  C    D
  2015-07-09 12:00:00  1  1  1  NaN
  2015-07-09 13:00:00  1  1  1  NaN
  2015-07-09 14:00:00  2  2  2    2
  2015-07-09 15:00:00  2  2  2    2
  2015-07-09 16:00:00  2  2  2    2
  2015-07-09 17:00:00  2  2  2    2
  </code></pre>