title: Extracting latest values in a Dask dataframe with non-unique index column dates
body: <p>I'm quite familiar with pandas dataframes but I'm very new to Dask so I'm still trying to wrap my head around parallelizing my code.
  I've obtained my desired results using pandas and pandarallel already so what I'm trying to figure out is if I can scale up the task or speed it up somehow using Dask.</p>
  <p>Let's say my dataframe has datetimes as non-unique indices, a values column and an id column.</p>
  <pre><code>time                        value   id
  2021-01-01 00:00:00.210281  28.08   293707
  2021-01-01 00:00:00.279228  28.07   293708
  2021-01-01 00:00:00.697341  28.08   293709
  2021-01-01 00:00:00.941704  28.08   293710
  2021-01-01 00:00:00.945422  28.07   293711
  ...     ...     ...
  2021-01-01 23:59:59.288914  29.84   512665
  2021-01-01 23:59:59.288914  29.83   512666
  2021-01-01 23:59:59.288914  29.82   512667
  2021-01-01 23:59:59.525227  29.84   512668
  2021-01-01 23:59:59.784754  29.84   512669
  </code></pre>
  <p>What I want to extract is the latest value for every second. e.g. if the price right before <code>2021-01-01 00:00:01</code> is the row with the index of <code>2021-01-01 00:00:00.945422</code> the latest value is <code>28.07</code>.</p>
  <p>In my case, sometimes index values are not unique so as a tie breaker, I'd like to use the <code>id</code> column. The value with the largest <code>id</code> number will be considered the latest value. For the case of the three values tied at the time <code>2021-01-01 23:59:59.288914</code>, the value <code>29.82</code> would be chosen since the largest <code>id</code> for that date would be <code>512667</code>. Also note that <code>id</code> is not consistent throughout the dataset and I cannot only rely on it for ordering my data.</p>
  <p>In pandas I simply do this by obtaining the last index</p>
  <pre><code>last_index = df.loc[date_minus60: date_curr].index[-1]
  last_values = df.loc[last_index]
  </code></pre>
  <p>and then if the value of <code>last_values.index.is_unique</code> is false, I finally perform <code>last_values.sort_values('id').iloc[-1]</code>.</p>
  <p>I've been having a hard time translating this code to Dask encountering issues regarding my delayed function resulting to them to need computing before I can reindex my dataframe again.</p>
  <p>I'd like to know if there are any best practices to dealing with this sort of problem.</p>