title: How to check in which datetime period / time block a datetime belongs to?
body: <p>I am having a stream of timestamped data parsed and put into a <code>DataFrame</code>. The timestamps are ordered and incremental. They represent events happening.</p>
  
  <p>I want to <code>resample</code> the data using <code>pandas.DataFrame.resample</code> for an arbitrary window size <code>x</code>. I also want to have a flag/check to see if the last event that has arrived does not belong to the current window but has moved to the next window of size <code>x</code>.</p>
  
  <pre><code>                    Timespans
  15:00         16:00           17:00           18:00
  |-------A-------|-------B-------|-------C-------|
         event_a^   ^event_b
  </code></pre>
  
  <p>How to check that <code>event_b.time</code> does not belong in the same time span as <code>event_b.time</code>. </p>
  
  <p><code>event_a.time</code> is a <code>pandas.Timestamp</code> object</p>