title: How to add missing dates to index with correct date format in pandas?
body: <p>I have a csv file which looks like below</p>
  
  <pre><code>327,2018-02-12 23:30:18.255810+00:00,Pur,10.11.100.1,WSE,8.0,23.0,6.5,0.0,,,,,,,,
  328,2018-02-12 23:30:22.718605+00:00,Bol,10.11.100.1,DEF,8.0,23.0,11.41,0.0,,,,,,,,
  333,2018-02-13 00:00:17.886487+00:00,Cal,10.11.100.1,WSE,9.0,23.0,10.5,0.0,,,,,,,,
  334,2018-02-13 00:00:21.948083+00:00,Moe,10.11.100.1,CFG,9.0,23.0,21.5,0.0,,,,,,,,
  436,2018-02-15 11:00:11.137740+00:00,Cad,10.11.100.1,MOD,5.0,24.0,3.17,0.0,,,,,,,,
  437,2018-02-15 11:27:20.994247+00:00,Ric,10.11.100.1,DEF,7.0,24.0,9.5,0.0,,,,,,,,
  877,2018-02-17 01:34:10.662735+00:00,Pit,10.4.100.1,CFD,6.0,3.0,37.23,0.0,,,,,,,,
  878,2018-02-20 00:04:39.855528+00:00,Bol,10.4.100.1,WSE,9.0,3.0,55.42,0.0,,,,,,,,
  </code></pre>
  
  <p>The date range is <code>2018-02-02</code> to <code>2018-04-13</code></p>
  
  <p>I have tried doing something like this as mentioned here <a href="https://stackoverflow.com/questions/45506038/pandas-reindex-to-fill-missing-dates-or-better-method-to-fill">Pandas Reindex to Fill Missing Dates, or Better Method to Fill?</a></p>
  
  <pre><code>df = pd.read_csv(file, parse_dates=["date"])
  df.set_index("date", inplace=True)
  df.index = pd.to_datetime(df.index,format='%Y-%m-%d %H:%M:%S.%f')
  d2 = pd.DataFrame(index=pd.date_range('2018-02-02','2018-04-13'))
  print(df.join(d2,how='right'))
  </code></pre>
  
  <p>But this doesn't seem to work.I still have some missing dates.What is the correct way to fill up the missing dates and assign <code>0</code> to its associated values?</p>