title: Combine pandas Data Frames based on a condition?
body: <p>Hi I have two dataframes like below: df_com and df_tra respectively</p>
  
  <pre><code>Event Type  Event Type  ID  Time_Comptel    Distance_Comptel    Fibre Line  Event Date  Event Date
  0   Digging Manual Digging  11988339    2019-06-26 12:27:44 444.83  Helios 1012, Channel 2  2019-06-26  2019-06-28
  1   Digging Manual Digging  11988337    2019-06-26 12:22:10 447.55  Helios 1012, Channel 2  2019-06-26  2019-06-28
  2   Digging Manual Digging  11988336    2019-06-26 12:26:50 446.19  Helios 1012, Channel 2  2019-06-26  2019-06-28
  3   Digging Manual Digging  11988335    2019-06-26 12:22:13 447.55  Helios 1012, Channel 2  2019-06-26  2019-06-28
  4   Digging Manual Digging  11988334    2019-06-26 12:10:05 446.87  Helios 1012, Channel 2  2019-06-26  2019-06-28
  
  
  Alarm ID    Event Type  Event Type  Event Date  Event Date  Position    Distance_Tranzmeo   Event Channel   Event Time  Time_Tranzmeo
  0   454.0   Digging Manual Digging  2019-06-26  2019-06-28  43.0    0.293   1.0 06:09 am    2019-06-28 06:09:00
  1   455.0   Digging Manual Digging  2019-06-26  2019-06-28  2585.0  17.594  1.0 06:09 am    2019-06-28 06:09:00
  2   456.0   Digging Manual Digging  2019-06-26  2019-06-28  2585.0  17.594  1.0 06:50 am    2019-06-28 06:50:00
  3   457.0   Digging Manual Digging  2019-06-26  2019-06-28  45.0    0.306   1.0 07:04 am    2019-06-28 07:04:00
  4   458.0   Digging Manual Digging  2019-06-26  2019-06-28  44.0    0.299   1.0 07:26 am    2019-06-28 07:26:00
  </code></pre>
  
  <p>I like to create another dataframe such that the <code>Time_Comptel</code> should be close to <code>Time_Tranzmeo</code> (any row, need not be respective rows) (close meaning max differnce between them should be + or - 1 hour and <code>Distance_Comptel</code> and <code>Distance_tranzmeo</code> should close (+ or - 100) as well.</p>
  
  <p>Join Such rows column wise and append to a dataframe (<code>df_match</code>) and rest to another datafame(<code>df_nomatch</code>). How is this possible? Sorry I am not yet able to come up with Ideas myself checking respective rows I get but I need to compare every combination.How can it be done. </p>
  
  <pre><code>Note: Time_Tranzmeo is the last column in dataframe 2
  </code></pre>
  
  <p>If I have underemphasised sth please let me know in the comments</p>