title: filter pandas dataframe by time
body: <p>I have a pandas dataframe which I want to subset on time greater or less than 12pm. First i convert my string datetime to datetime[64]ns object in pandas.</p>
  
  <pre><code>segments_data['time'] = pd.to_datetime((segments_data['time']))
  </code></pre>
  
  <p>Then I separate time,date,month,year &amp; dayofweek like below.</p>
  
  <pre><code>import datetime as dt
  
  segments_data['date'] = segments_data.time.dt.date
  segments_data['year'] = segments_data.time.dt.year
  segments_data['month'] = segments_data.time.dt.month
  segments_data['dayofweek'] = segments_data.time.dt.dayofweek
  segments_data['time'] = segments_data.time.dt.time
  </code></pre>
  
  <p>My time column looks like following. </p>
  
  <pre><code>segments_data['time']
  Out[1906]: 
    07:43:00
    07:52:00
    08:00:00
    08:42:00
    09:18:00
    09:18:00
    09:18:00
    09:23:00
    12:32:00
    12:43:00
    12:55:00
    Name: time, dtype: object
  </code></pre>
  
  <p>Now I want to subset dataframe with time greater than 12pm and time less than 12pm. </p>
  
  <pre><code>segments_data.time[segments_data['time'] &lt; 12:00:00]
  </code></pre>
  
  <p>It doesn't work because <code>time</code> is a <code>string object</code>.</p>