pricing = get_pricing(['AAPL', 'MSFT'], start_date='2014-01-01', end_date='2014-01-07', frequency='minute', fields='price') pricing.head(10) from pandas.tseries.tools import normalize_date def my_grouper(ts): "Function to apply to the index of the DataFrame to break it into groups." # Returns midnight of the supplied date. return normalize_date(ts) def first_thirty_minutes(frame): "Function to apply to the resulting groups." return frame.iloc[:30] data = pricing.groupby(my_grouper).apply(first_thirty_minutes) data.head(40) from pandas import Timestamp # This gives us the first thirty minutes of January 3rd. data.loc[Timestamp('2014-01-03', tz='UTC')] data.xs(Timestamp('2014-01-03 14:58:00', tz='UTC'), level=1) data_copy = data.copy() data_copy.index = data_copy.index.droplevel(0) data_copy.head()