Resampling (Upsample) Pandas multiindex dataframe
<p>Here is a sample dataframe for reference:</p>

<pre><code>import pandas as pd
import datetime
import numpy as np
np.random.seed(1234)

arrays = [np.sort([datetime.date(2016, 8, 31), datetime.date(2016, 7, 31), datetime.date(2016, 6, 30)]*3),
         ['A', 'B', 'C', 'D', 'E']*5]
df = pd.DataFrame(np.random.randn(15, 4), index=arrays)
df.index.rename(['date', 'id'], inplace=True)
</code></pre>

<p>What it looks like:</p>

<p><a href="http://i.stack.imgur.com/dsrRV.png" rel="nofollow"><img src="http://i.stack.imgur.com/dsrRV.png" alt="enter image description here"></a></p>

<p>I would like to resample the <code>date</code> level of the multiindex to weekly frequency <code>W-FRI</code> via upsampling, i.e., copying from the most recent values <code>how='last'</code>.  The examples I've seen usually end up aggregating the data (which I want to avoid) after using the <code>pd.Grouper</code> function.</p>

<p>Edit: I have found a solution below, but I wonder if there is a more efficient method.</p>

<p>Edit: I have found a solution:</p>

<pre><code>df.unstack().resample('W-FRI', how='last', fill_method='ffill')
</code></pre>

<p>but I wonder if there's a more efficient way to do this.</p>

python pandas dataframe multi-index resampling