title: Impute missing dates and values using Python
body: <p>I have a file named df that has the following values:</p>
  <pre><code>  Date              Available        Used        Total       Free
   
    06072019          5                19          24          5
    06202019          14               10          24          6           
    07072019          6                16          24          6
    07202019          20               4           24          20
    08072019          23               1           24          23
  </code></pre>
  <p>I am missing the date 08202019 and am looking to impute the missing values with the average of the existing data that I have.</p>
  <p>This is what I am currently doing:</p>
  <pre><code>import numpy as np
  import datetime as dt
  
  
  df.groupby([df.index.date]).transform(lambda x: x.fill(x.mean()))
  </code></pre>
  <p>However, I know that some of the syntax is not correct here and would like some suggestions.</p>