title: Combine two time-series with different element of the datetime index in Python
body: <p>I have two <code>time-series</code> below. <code>df1</code> has an index in a <code>DateTime</code> format which includes <strong>only date</strong> without time. <code>df2</code> has a full datetime index, also in a <code>DateTime</code> format. In the full data, <code>df1</code> is much shorter than <code>df2</code> in terms of the number of rows.   </p>
  
  <p>As you can see, both datasets span from the 2nd to the 6th of April. df1, however, skips some dates, while in df2, all days are available. Note: in this example, only odd dates are skipped, but it is not the case in the full data. </p>
  
  <p><strong>df1</strong></p>
  
  <pre><code>    value1
  date            
  2016-04-02  16
  2016-04-04  76
  2016-04-06  23
  </code></pre>
  
  <p><strong>df2</strong>   </p>
  
  <pre><code>    value2
  DateTime    
  2016-04-02 07:45:00 257.96
  2016-04-02 07:50:00 317.58
  2016-04-02 07:55:00 333.39
  2016-04-03 08:15:00 449.96
  2016-04-03 08:20:00 466.42
  2016-04-03 08:25:00 498.56
  2016-04-04 08:10:00 454.73
  2016-04-04 08:15:00 472.45
  2016-04-04 08:20:00 489.85
  2016-04-05 07:30:00 169.54
  2016-04-05 07:35:00 276.13
  2016-04-05 07:40:00 293.70
  2016-04-06 07:10:00 108.05
  2016-04-06 07:15:00 179.21
  2016-04-06 07:20:00 201.80
  </code></pre>
  
  <p>I want to combine the two datasets by index. df1 should controls which dates to be kept. The <strong>expected</strong> result is below.   </p>
  
  <pre><code>    value2  value1
  DateTime    
  2016-04-02 07:45:00 257.96  16
  2016-04-02 07:50:00 317.58  16
  2016-04-02 07:55:00 333.39  16
  2016-04-04 08:10:00 454.73  76
  2016-04-04 08:15:00 472.45  76
  2016-04-04 08:20:00 489.85  76
  2016-04-06 07:10:00 108.05  23
  2016-04-06 07:15:00 179.21  23
  2016-04-06 07:20:00 201.80  23
  </code></pre>
  
  <p>This is my attempt.   </p>
  
  <pre><code>result= pd.concat([df1, df1], axis=1, sort=True).dropna(how='all')
  </code></pre>
  
  <p>But the result is different to what I expect.</p>