title: Python Pandas: Split a time series per month or week
body: <p>I have a time series that spans a few years, in the following format:</p>
  <pre><code>              timestamp open    high    low    close    volume
  0   2009-01-02 05:00:00 900.00  906.75  898.00  904.75  15673.0
  1   2009-01-02 05:30:00 904.75  907.75  903.75  905.50  4600.0
  2   2009-01-02 06:00:00 905.50  907.25  904.50  904.50  3472.0
  3   2009-01-02 06:30:00 904.50  905.00  903.25  904.75  6074.0
  4   2009-01-02 07:00:00 904.75  905.50  897.00  898.25  12538.0
  </code></pre>
  <p>What would be the simplest way to split that dataframe into multiple dataframes of 1 week or 1 month worth of data?</p>
  <p>As an example, a dataframe containing 1 year of data would be split in 52 dataframes containing a week of data and returned as a list of 52 dataframes.</p>
  <p>The data can be reconstructed with the code below:</p>
  <pre><code>import pandas as pd
  from pandas import Timestamp
  dikt={'close': {0: 904.75, 1: 905.5, 2: 904.5, 3: 904.75, 4: 898.25}, 'low': {0: 898.0, 1: 903.75, 2: 904.5, 3: 903.25, 4: 897.0}, 'open': {0: 900.0, 1: 904.75, 2: 905.5, 3: 904.5, 4: 904.75}, 'high': {0: 906.75, 1: 907.75, 2: 907.25, 3: 905.0, 4: 905.5}, 'volume': {0: 15673.0, 1: 4600.0, 2: 3472.0, 3: 6074.0, 4: 12538.0}, 'timestamp': {0: Timestamp('2009-01-02 05:00:00'), 1: Timestamp('2009-01-02 05:30:00'), 2: Timestamp('2009-01-02 06:00:00'), 3: Timestamp('2009-01-02 06:30:00'), 4: Timestamp('2009-01-02 07:00:00')}}
  df = pd.DataFrame(dikt, columns=['timestamp', 'open', 'high', 'low', 'close', 'volume'])
  </code></pre>