title: Fill missing values using groupby Pandas ValueError
body: <p>I am trying to fill the missing values in the 'Date' column of my dataset.</p>
  <pre><code>CODE        City        Date         TAVG    TMAX   TMIN
  CA003033890 Lethbridge  08-01-2020  -3.55    4.7    -11.8
  CA003033890 Lethbridge  09-01-2020  -17.05  -11.5   -22.6
  CA003033890 Lethbridge  10-01-2020  -13.7   -1.9    -25.5
  CA003033890 Lethbridge  11-01-2020  -7.8     0.7    -16.3
  CA003033890 Lethbridge  12-01-2020  -20.3   -16.3   -24.3
  CA003033890 Lethbridge  13-01-2020  -24.6   -22.4   -26.8
  CA003033890 Lethbridge  14-01-2020  -27     -23.7   -30.3
  CA003033890 Lethbridge  15-01-2020  -29.55  -26.8   -32.3
  CA003033890 Lethbridge  16-01-2020  -26.05  -23.2   -28.9
  CA003033890 Lethbridge  17-01-2020  -23.45  -19.2   -27.7
  </code></pre>
  <p>For the above code <code>CA003033890</code>, notice that the dates from 01-01-2020 to 07-01-2020 are missing, similarly for other <code>CODE</code>s, <code>Date</code> column values are randomly missing.</p>
  <p>This is the code that I tried</p>
  <pre><code>data.Date=pd.to_datetime(data.Date)
  merge_df  = data.set_index('Date').groupby('CODE').apply(lambda x : x.resample('D').max().ffill()).reset_index(level=1)
  </code></pre>
  <p>When I ran it, it seemed to run forever and later returned the below error</p>
  <pre><code>Traceback (most recent call last):                                                                                                                                                                                                                      
    File &quot;test.py&quot;, line 45, in &lt;module&gt;                                                                                                                                                                                                                  
      data['Date'] = data.groupby('CODE')['Date'].apply(lambda d: d.reindex(pd.date_range(min(df1.Date),max(df1.Date),freq='D'))).drop('CODE', axis=1).reset_index('CODE').fillna(value=None)                                                             
    File &quot;C:\Python\Python38\lib\site-packages\pandas\core\series.py&quot;, line 4132, in drop                                                                                                                                                                 
      return super().drop(                                                                                                                                                                                                                                
    File &quot;C:\Python\Python38\lib\site-packages\pandas\core\generic.py&quot;, line 3923, in drop                                                                                                                                                                
      axis_name = self._get_axis_name(axis)                                                                                                                                                                                                               
    File &quot;C:\Python\Python38\lib\site-packages\pandas\core\generic.py&quot;, line 420, in _get_axis_name                                                                                                                                                       
      raise ValueError(f&quot;No axis named {axis} for object type {cls}&quot;)                                                                                                                                                                                     
  ValueError: No axis named 1 for object type &lt;class 'pandas.core.series.Series'&gt; 
  </code></pre>
  <p>Expected Dataset(NaNs in the datset)</p>
  <pre><code>CODE        City        Date        TAVG    TMAX    TMIN
  CA003033890 Lethbridge  01-01-2020          
  CA003033890 Lethbridge  02-01-2020          
  CA003033890 Lethbridge  03-01-2020          
  CA003033890 Lethbridge  04-01-2020          
  CA003033890 Lethbridge  05-01-2020          
  CA003033890 Lethbridge  06-01-2020          
  CA003033890 Lethbridge  07-01-2020          
  CA003033890 Lethbridge  08-01-2020  -3.55    4.7    -11.8
  CA003033890 Lethbridge  09-01-2020  -17.05  -11.5   -22.6
  CA003033890 Lethbridge  10-01-2020  -13.7   -1.9    -25.5
  </code></pre>
  <p>Also, is there a faster way to achieve this?</p>