title: How selected time period in a pandas dataframe?
body: <p>As explain in that Q&amp;A : <a href="https://stackoverflow.com/questions/16175874/python-pandas-dataframe-slicing-by-date-conditions">python pandas dataframe slicing by date conditions</a> I want to select periods of time in a pandas dataframe. The answer given works perfectly for a day-slicing, but won't work if you wan't to look at the hours only.</p>
  
  <p>Here's an example of what I am want to do :</p>
  
  <pre><code>2013-12-12 10:51:51
  2013-12-12 11:11:01
  2013-12-12 11:19:22
  2013-12-12 11:36:48
  2013-12-12 11:36:48
  </code></pre>
  
  <p><code>hour_frame(df, 11,00,00,11,30,00) # I want to select items between 11h00 and 11h30</code></p>
  
  <pre><code>2013-12-12 11:11:01
  2013-12-12 11:19:22
  </code></pre>
  
  <p>I tried to use the code given in the answer (cf. the link above)</p>
  
  <pre><code>def hour_frame(df,start_hour,start_minute,end_hour,end_minute):
  
      start_time = pd.Timestamp('%d:%d:%d' % (start_hour, start_minute, 0)).strftime('%Y-%m-%d %H:%M:%S')
      end_time = pd.Timestamp('%d:%d:%d' % (end_hour, end_minute, 0)).strftime('%Y-%m-%d %H:%M:%S')
  
      return df.ix[start_time:end_time]
  </code></pre>
  
  <p>But It return an empty dataframe, I looked at the values of <code>start_time</code> and <code>end_time</code> and they were :</p>
  
  <pre><code>start_time = 2014-07-09 11:00:00
  end_time =   2014-07-09 11:30:00
  </code></pre>
  
  <p>So my problem is that when I create the strings, it will fill automatically the date with the current day, and I don't know how compare the date only looking at the hours.</p>