title: Work with date in DataFrame in Python Pandas?
body: <p>I have DataFrame like below:</p>
  <pre><code>rng = pd.date_range('2020-12-01', periods=5, freq='D')
  df = pd.DataFrame({&quot;ID&quot; : [&quot;1&quot;, &quot;2&quot;, &quot;1&quot;, &quot;1&quot;, &quot;2&quot;],
                     &quot;Date&quot; : rng,
                     &quot;status&quot; : [&quot;B2&quot;, &quot;G8&quot;, &quot;G8&quot;, &quot;R7&quot;, &quot;G8&quot;]})
  </code></pre>
  <p>And I need to create DataFrame where will be:</p>
  <ol>
  <li>New1 = date of the last agreement with B2 status</li>
  <li>New2 = date of the last agreement with G8 status</li>
  </ol>
  <p>Below I upload result which I need:</p>
  <p><a href="https://i.stack.imgur.com/DhjPV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DhjPV.png" alt="enter image description here" /></a></p>