Custom Time Periods with Groupby
<p>I've got the following Pandas DataFrame:</p>

<pre><code>import datetime as dt
import pandas as pd
import numpy as np

offset = 3 * pd.tseries.offsets.BMonthEnd()

bond_index_1 = pd.date_range('1/1/14', '1/1/18', freq=offset, name='date')
bond_1 = pd.DataFrame(data = np.random.uniform(0, 5, 16),
                      index= bond_index_1, columns=['cash_flow'])

bond_index_2 = pd.date_range('3/1/14', '3/1/21', freq=offset, name='date')
bond_2 = pd.DataFrame(data = 2*np.random.uniform(0, 10, 28),
                      index= bond_index_2, columns=['cash_flow'])

df_merged = pd.concat([bond_1, bond_2], keys=['Bond_1', 'Bond_2'])
</code></pre>

<p>How can I get a sum of the values in the <code>cash_flow</code> column by a <strong>custom range, starting at 2014-6-30, ending at 2016-12-31 in 6 Month intervals</strong>.</p>

<p>Therefore, the intervals would look like 2014-06-30, 2015-12-31, 2015-06-30, 2015-12-31, 2016-06-30, 2016-12-31</p>

<p>It would also ignore the 'bond' name index in the MultiIndex.</p>

<p>I've tried using <code>TimeGrouper</code> but couldn't get it to work since <code>TimeGrouper</code> starts at the earliest value in your time series and moves forward.</p>