title: Mapping ranges of date in pandas dataframe
body: <p>I would like to map values defined in a dictionary of <code>date: value</code> into a DataFrame of dates.</p>
  <p>Consider the following example:</p>
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  
  df = pd.DataFrame(range(19), index=pd.date_range(start=&quot;2010-01-01&quot;, end=&quot;2010-01-10&quot;, freq=&quot;12H&quot;))
  
  dct = {
      &quot;2009-01-01&quot;: 1,
      &quot;2010-01-05&quot;: 2,
      &quot;2020-01-01&quot;: 3,
  }
  </code></pre>
  <p>I would like to get something like this:</p>
  <pre class="lang-py prettyprint-override"><code>df
                        0  test
  2010-01-01 00:00:00   0   1.0
  2010-01-01 12:00:00   1   1.0
  2010-01-02 00:00:00   2   1.0
  2010-01-02 12:00:00   3   1.0
  2010-01-03 00:00:00   4   1.0
  2010-01-03 12:00:00   5   1.0
  2010-01-04 00:00:00   6   1.0
  2010-01-04 12:00:00   7   1.0
  2010-01-05 00:00:00   8   2.0
  2010-01-05 12:00:00   9   2.0
  2010-01-06 00:00:00  10   2.0
  2010-01-06 12:00:00  11   2.0
  2010-01-07 00:00:00  12   2.0
  2010-01-07 12:00:00  13   2.0
  2010-01-08 00:00:00  14   2.0
  2010-01-08 12:00:00  15   2.0
  2010-01-09 00:00:00  16   2.0
  2010-01-09 12:00:00  17   2.0
  2010-01-10 00:00:00  18   2.0
  </code></pre>
  <p>I have tried the following but I get a list of nan:</p>
  <pre class="lang-py prettyprint-override"><code>df[&quot;test&quot;] = pd.Series(df.index.map(dct), index=df.index).ffill()
  </code></pre>
  <p>Any suggestions?</p>