title: Creating date column using Pandas with the date gaps filled between specific period using asfreq
body: <p>Suppose I have a Pandas dataframe with <code>'Date'</code> column whose values have gaps like below:</p>
  <pre><code>&gt;&gt;&gt; import pandas as pd
  &gt;&gt;&gt; data = [['2021-01-02', 1.0], ['2021-01-05', 2.0], ['2021-02-05', 3.0]]
  &gt;&gt;&gt; df = pd.DataFrame(data, columns=['Date','$'])
  &gt;&gt;&gt; df
           Date    $
  0  2021-01-02  1.0
  1  2021-01-05  2.0
  2  2021-02-05  3.0
  </code></pre>
  <p>I would like to fill the gaps in the <code>'Date'</code> column from the period between Jan 01, 2021 to Feb 28, 2021 while copying (forward-filling) the values, so from some reading up on StackOverflow posts like <a href="https://stackoverflow.com/a/45469266">this</a>, I came up with this solution to transform the dataframe as shown below:</p>
  <pre><code># I need to first convert values in 'Date' column to datetime64 type
  &gt;&gt;&gt; df['Date'] = pd.to_datetime(df['Date'])
  # Then I have to set 'Date' column as the dataframe's index
  &gt;&gt;&gt; df = df.set_index(['Date'])
  # Without doing the above two steps, the call below returns error
  &gt;&gt;&gt; df_new=df.asfreq(freq='D', how={'start':'2021-01-01', 'end':'2021-03-31'}, method='ffill')
  &gt;&gt;&gt; df_new
                $
  Date
  2021-01-02  1.0
  2021-01-03  1.0
  2021-01-04  1.0
  2021-01-05  2.0
  2021-01-06  2.0
  2021-01-07  2.0
  2021-01-08  2.0
  2021-01-09  2.0
  2021-01-10  2.0
  ...
  2021-01-31  2.0
  2021-02-01  2.0
  2021-02-02  2.0
  2021-02-03  2.0
  2021-02-04  2.0
  2021-02-05  3.0
  </code></pre>
  <p>But as you can see above, the dates in <code>df_new</code> only starts at <code>'2021-01-02'</code> instead of <code>'2021-01-01'</code> AND it ends on <code>'2021-02-05'</code> instead of <code>'2021-02-28'</code>. I hope I'm entering the input for <code>how</code> parameter correctly above.</p>
  <p>Q1: What else do I need to do to make the resulting dataframe look like below:</p>
  <pre><code>&gt;&gt;&gt; df_new
                $
  Date
  2021-01-01  1.0
  2021-01-02  1.0
  2021-01-03  1.0
  2021-01-04  1.0
  2021-01-05  2.0
  2021-01-06  2.0
  2021-01-07  2.0
  2021-01-08  2.0
  2021-01-09  2.0
  2021-01-10  2.0
  ...
  2021-01-31  2.0
  2021-02-01  2.0
  2021-02-02  2.0
  2021-02-03  2.0
  2021-02-04  2.0
  2021-02-05  3.0
  2021-02-06  3.0
  ...
  2021-02-28  3.0
  </code></pre>
  <p>Q2: Is there any way I can accomplish this simpler (i.e. without having to set the <code>'Date'</code> column as the index of the dataframe for example)</p>
  <p>Thanks in advance for your suggestions/answers!</p>