title: Interleaving Pandas Dataframes by Timestamp
body: <p>I've got 2 Pandas DataFrame, each of them containing 2 columns. One of the columns is a timestamp column [t], the other one contains sensor readings [s].</p>
  
  <p>I now want to create a single DataFrame, containing 4 columns, that is interleaved on the timestamp column.</p>
  
  <p>Example:</p>
  
  <p>First Dataframe:</p>
  
  <pre><code>+----+----+
  | t1 | s1 |
  +----+----+
  |  0 |  1 |
  |  2 |  3 |
  |  3 |  3 |
  |  5 |  2 |
  +----+----+
  </code></pre>
  
  <p>Second DataFrame:</p>
  
  <pre><code>+----+----+
  | t2 | s2 |
  +----+----+
  |  1 |  5 |
  |  2 |  3 |
  |  4 |  3 |
  +----+----+
  </code></pre>
  
  <p>Target:</p>
  
  <pre><code>+----+----+----+----+
  | t1 | t2 | s1 | s2 |
  +----+----+----+----+
  |  0 |  0 |  1 |  0 |
  |  0 |  1 |  1 |  5 |
  |  2 |  1 |  3 |  5 |
  |  2 |  2 |  3 |  3 |
  |  3 |  2 |  3 |  3 |
  |  3 |  4 |  3 |  3 |
  |  5 |  4 |  2 |  3 |
  +----+----+----+----+
  </code></pre>
  
  <p>I hat a look at pandas.merge, but that left me with a lot of NaNs and an unsorted table.</p>
  
  <pre><code>a.merge(b, how='outer')
  Out[55]: 
     t1  s1  t2  s2
  0   0   1 NaN NaN
  1   2   3   2   3
  2   3   3 NaN NaN
  3   5   2 NaN NaN
  4   1 NaN   1   5
  5   4 NaN   4   3
  </code></pre>