title: select top n rows after resampling DatetimeIndex
body: <p>I need to get top n rows by some value per week (and I have hourly data).</p>
  <p><em>data</em>:</p>
  <pre class="lang-py prettyprint-override"><code>import numpy as np 
  import pandas as pd
  
  
  dates = pd.date_range(start='1/1/2020', end='11/1/2020', freq=&quot;1H&quot;)
  values = np.random.randint(20, 100500, len(dates))
  some_other_column = np.random.randint(0, 10000000, len(dates))
  df = pd.DataFrame({&quot;date&quot;: dates, &quot;value&quot;: values, &quot;another_column&quot;: some_other_column})
  </code></pre>
  <p>My attempt:</p>
  <pre class="lang-py prettyprint-override"><code>resampled = df.set_index(&quot;date&quot;).resample(&quot;W&quot;)[&quot;value&quot;].nlargest(5).to_frame()
  </code></pre>
  <p>It does give top 5 rows but all other columns except for <code>date</code> and <code>value</code> are missing - and I want to keep them all (in my dataset I have lots of columns but here <code>another_column</code> just to show that it's missing).</p>
  <p>The solution I came up with:</p>
  <pre class="lang-py prettyprint-override"><code>resampled.index.names = [&quot;week&quot;, &quot;date&quot;]
  result = pd.merge(
      resampled.reset_index(),
      df,
      how=&quot;left&quot;,
      on=[&quot;date&quot;, &quot;value&quot;]
  )
  </code></pre>
  <p>But it all feels wrong, I know there should be much simpler solution. Any help?</p>