Add missing date index in dataframe
<p>I have loaded a CSV files with index datetime which is the last day of months in a year. I wanted to fill missing dates with empty values as rows.</p>

<p>Following is my CSV file structure</p>

<pre><code>Date    Australia   China
2011-01-31  4.75    5.81
2011-02-28  4.75    5.81
2011-03-31  4.75    6.06
2011-04-30  4.75    6.06
</code></pre>

<p>I want to fill all the dates in a month with empty columns.</p>

<p>I tried the following code but it is not working.</p>

<pre><code>import pandas as pd
df = pd.read_csv("data.csv", index_col="Date")
df.reindex(pd.date_range("2011-01-01", "2011-10-31"), fill_value="NaN")
</code></pre>