title: How to join two dataframes for which column values are within a certain range?
body: <p>Given two dataframes <code>df_1</code> and <code>df_2</code>, how to join them such that datetime column <code>df_1</code> is in between <code>start</code> and <code>end</code>  in dataframe <code>df_2</code>:</p>
  
  <pre><code>print df_1
  
    timestamp              A          B
  0 2016-05-14 10:54:33    0.020228   0.026572
  1 2016-05-14 10:54:34    0.057780   0.175499
  2 2016-05-14 10:54:35    0.098808   0.620986
  3 2016-05-14 10:54:36    0.158789   1.014819
  4 2016-05-14 10:54:39    0.038129   2.384590
  
  
  print df_2
  
    start                end                  event    
  0 2016-05-14 10:54:31  2016-05-14 10:54:33  E1
  1 2016-05-14 10:54:34  2016-05-14 10:54:37  E2
  2 2016-05-14 10:54:38  2016-05-14 10:54:42  E3
  </code></pre>
  
  <p>Get corresponding <code>event</code> where <code>df1.timestamp</code> is between <code>df_2.start</code> and <code>df2.end</code> </p>
  
  <pre><code>  timestamp              A          B          event
  0 2016-05-14 10:54:33    0.020228   0.026572   E1
  1 2016-05-14 10:54:34    0.057780   0.175499   E2
  2 2016-05-14 10:54:35    0.098808   0.620986   E2
  3 2016-05-14 10:54:36    0.158789   1.014819   E2
  4 2016-05-14 10:54:39    0.038129   2.384590   E3
  </code></pre>