title: How to add a column containing sequential counts based on the order of another column?
body: <p>I have a dataframe like below:</p>
  <pre><code>data = [[&quot;Item_1&quot;, '2020-06-01'], [&quot;Item_1&quot;, &quot;2021-05-01&quot;], [&quot;Item_1&quot;, '2019-02-10'],
         [&quot;Item_2&quot;, '2020-04-01'], [&quot;Item_2&quot;, &quot;2018-05-01&quot;]]
  
  df = pd.DataFrame(data, columns=[&quot;Item_ID&quot;, &quot;Dates&quot;])
  </code></pre>
  <pre><code>Item ID   Dates
  Item_1    2020-06-01
  Item_1    2020-05-01
  Item_1    2019-02-10
  Item_2    2020-04-01
  Item_2    2018-05-01
  </code></pre>
  <p>I am hoping to add a column that contains a count based on the date order. So that table would look like below, where the <code>Dates</code> column is re-ordered and the count column reflects the order with which the <code>Item ID</code> is dated:</p>
  <pre><code>Item ID   Dates       Count
  Item_1    2019-02-10    1
  Item_1    2020-05-01    2
  Item_1    2020-06-01    3
  Item_2    2016-02-10    1
  Item_2    2018-05-01    2
  </code></pre>
  <p>Is there a way to do this that doesn't rely on a <code>groupby</code> operation such that the original dataframe is updated with this new column?</p>