title: pandas, python - how to select specific times in timeseries
body: <p>I worked now for quite some time using python and pandas for analysing a set of hourly data and find it quite nice (Coming from Matlab.)</p>
  
  <p>Now I am kind of stuck. I created my <code>DataFrame</code> like that:</p>
  
  <pre><code>SamplingRateMinutes=60
  index = DateRange(initialTime,finalTime, offset=datetools.Minute(SamplingRateMinutes))
  ts=DataFrame(data, index=index)
  </code></pre>
  
  <p>What I want to do now is to select the Data for all days at the hours 10 to 13 and 20-23 to use the data for further calculations.
  So far I sliced the data using</p>
  
  <pre><code> selectedData=ts[begin:end]
  </code></pre>
  
  <p>And I am sure to get some kind of dirty looping to select the data needed. But there must be a more elegant way to index exacly what I want. I am sure this is a common problem and the solution in pseudocode should look somewhat like that:</p>
  
  <pre><code>myIndex=ts.index[10&lt;=ts.index.hour&lt;=13 or 20&lt;=ts.index.hour&lt;=23]
  selectedData=ts[myIndex]
  </code></pre>
  
  <p>To mention I am an engineer and no programer :) ... yet</p>