title: Create overlapping groups with pandas timegrouper
body: <p>I am using Pandas Timegrouper to group datapoints in a pandas dataframe in python:</p>
  
  <pre><code>grouped = data.groupby(pd.TimeGrouper('30S'))
  </code></pre>
  
  <p>I would like to know if there's a way to achieve window overlap, like suggested in this question: <a href="https://stackoverflow.com/questions/18247009/window-overlap-in-pandas">Window overlap in Pandas</a> while keeping the pandas dataframe as data structure.</p>
  
  <p>Update: tested timing of the three solutions proposed below and the rolling mean seems faster:</p>
  
  <pre><code>%timeit df.groupby(pd.TimeGrouper('30s',closed='right')).mean()
  %timeit df.resample('30s',how='mean',closed='right')
  %timeit pd.rolling_mean(df,window=30).iloc[29::30]
  </code></pre>
  
  <p>yields:</p>
  
  <pre><code>1000 loops, best of 3: 336 µs per loop
  1000 loops, best of 3: 349 µs per loop
  1000 loops, best of 3: 199 µs per loop
  </code></pre>