dr = pd.date_range(datetime(2009, 1, 1), datetime(2010, 12, 31), freq='H')
dt = pd.DataFrame(rand(len(dr), 2), dr)
hour = dt.index.hour
selector = (10 <= hour) & (hour <= 13) | (20 <= hour) & (hour <= 23)
data = dt[selector]
pandas, python - how to select specific times in timeseries