title: How do I get a Pandas TimeSeries for user sessions (using Pandas or Numpy)
body: <p>I've got some data which has the login and logout times for a series of users.</p>
  
  <p>Input:</p>
  
  <pre><code>        Login        Logout
  User_1  10:25AM      6:01PM
  User_2  8:58AM       5:12PM
  User_3  9:23AM       1:35PM
  User_3  3:10PM       4:49PM
  </code></pre>
  
  <p>I'd like to be able to find out the number of users that were logged in during a time period (for example, each Hour).</p>
  
  <p>I'd like to be able to correlate this to other data I have in Pandas for the same periods, e.g. the number of "Foo" Events during that time.</p>
  
  <p>Desired Output:</p>
  
  <pre><code>          Num Logged In   Foo Event Count
  9:00AM                1                11
  10:00AM               2                17
  11:00AM               3                28
  12:00PM               3                26
  1:00PM                3                22
  2:00PM                2                15
  3:00PM                2                15
  4:00PM                3                22
  5:00PM                2                13
  </code></pre>
  
  <p>In the simplest case I could get the number of users logged in at exactly 10:00AM, and that would be a useful start. If I were looking at re-sampling the data to Day periods, then I'd need to be cleverer and look at something like the maximum simultaneous logins, or the average number of simultaneous logins between 9:00AM to 5:00PM.</p>
  
  <p>Obviously I could write plain Python that, given the period I re-sampled to in Pandas, could give me the Series I need, but I'd like to know if there is a trick within Pandas that helps me with this, or something I could do in Numpy, as I want to apply this to largish datasets (hundreds of users, thousands of days, multiple login/logouts a day per user).</p>