title: Dealing with Duplicate Dates in Pandas
body: <p>The problem is that I have a large data set with missing date entries and also duplicates. I can't drop any of them so, I need to add the missing dates and have the corresponding columns be NaN.
  Here's a sample code of it.</p>
  
  <pre><code>df = pd.DataFrame({
  'timestamps': pd.to_datetime(
      ['2016-11-15 1:00','2016-11-16 2:00','2016-11-16 3:00','2016-11-18 4:00']),
  'values':['a','b','c','d']})
   df.index = pd.DatetimeIndex(df['timestamps']).floor('D')
  
   all_days = pd.date_range(df.index.min(), df.index.max(), freq='D')
  </code></pre>
  
  <p>While searching I found that we shouldn't go with <code>df.reindex()</code> as it can't handle duplicates. So the other solution is to use
       <code>df.loc[all_days]</code> but, everytime I use it as 
      <code>df.loc[all_days] = [0,0]</code> all it says is that my missing date, which I need to add to the dataframe, is not in the index.</p>
  
  <p>It should go from this:</p>
  
  <pre><code>           timestamps             values
  2016-11-15  "2016-11-15 01:00:00"  a
  2016-11-16  "2016-11-16 02:00:00"  b
  2016-11-16  "2016-11-16 03:00:00"  c
  2016-11-18  "2016-11-18 04:00:00"  d`
  </code></pre>
  
  <p>To this:</p>
  
  <pre><code>timestamps             values
  2016-11-15  "2016-11-15 01:00:00"  a
  2016-11-16  "2016-11-16 02:00:00"  b
  2016-11-16  "2016-11-16 03:00:00"  c 
  2016-11-17  NaN                    NaN
  2016-11-18  "2016-11-18 04:00:00"  d
  </code></pre>