title: Rolling over values from one column to other based on another dataframe
body: <p>I have two dataframes:
  <code>DF1</code></p>
  
  <pre><code>ID  DatePaid   Remaining
  A1  2018-01-01   8500
  A2  2018-02-15   2000
  A2  2018-02-28   1900
  A3  2018-04-12   3000
  A3  2018-05-12   2700
  A3  2018-05-17   110
  A3  2018-06-17   0
  A4  2018-06-18   10
  A5  2018-07-13   500 
  </code></pre>
  
  <p>Now I have another dataframe <code>DF2</code> which only have unique IDs from first dataframe, and dates that represent months:</p>
  
  <pre><code>ID 2018-01-31 2018-02-28 2018-03-31 2018-04-30 2018-05-31 2018-06-30 2018-07-31
  A1
  A2
  A3
  A4
  A5
  </code></pre>
  
  <p>So based on first dataframe I need to fill the values based on the <code>Remaining</code> value that is in the first dataframe that is within the corresponding month ( so for example I take the last value for the <code>A3</code> from <code>2018-05</code> and put it in the <code>2018-05-31</code> column in <code>DF2</code>. IF there are no other values for that ID just fill all the remaining columns in <code>DF</code> with the value in the most right filled column(roll over to the right).</p>
  
  <p>So the end result is exactly like this</p>
  
  <pre><code>ID  2018-01-31 2018-02-28 2018-03-31 2018-04-30 2018-05-31 2018-06-30 2018-07-31
  A1  8500        8500        8500      8500        8500        8500         8500
  A2   NA         1900        1900      1900        1900        1900         1900
  A3   NA          NA          NA       3000        110           0             0
  A4   NA          NA          NA        NA         NA           10            10
  A5   NA          NA          NA        NA         NA           NA           500
  </code></pre>