title: Smart algo to merge 2 dataframes on datetime column
body: <p>I have 2 dataframe, df1 is some traffic data:</p>
  <pre><code>id  mtm_id  date_p  travel_d    ut_p    travel_t
  0   1   2020-11-25 14:50:04 22.206  2.426   53.864
  1   1   2020-11-25 15:50:05 22.214  1.578   35.049
  2   1   2020-11-25 16:50:05 22.214  1.766   39.227
  3   1   2020-11-25 17:50:05 22.206  1.75    38.867
  4   1   2020-11-25 18:50:04 22.206  1.533   34.044
  ... ... ... ... ... ...
  7408    1   2021-10-02 19:50:06 22.205  1.502   33.358
  7409    1   2021-10-02 20:50:14 22.205  1.37    30.42
  7410    1   2021-10-02 21:50:05 22.205  1.342   29.791
  7411    1   2021-10-02 22:50:09 22.205  1.296   28.777
  7412    1   2021-10-02 23:50:06 22.688  1.196   27.144
  </code></pre>
  <p>and second df2 is weather data:</p>
  <pre><code>id date_w   temperature pressure    humidity    clouds  wind_speed
  0   2017-04-09 16:00:00 281.4   1019    49  Clear : clear sky, 0%   4
  1   2017-04-10 22:00:00 7.83    1012    81  Clear : ясно, 0%    3
  2   2017-04-11 15:00:00 18  1002    42  Clear : ясно, 0%    9
  3   2017-04-11 21:30:00 8.78    1003    93  Rain : дождь, 75%   5
  4   2017-04-12 15:30:00 6.25    1002    60  Clouds : слегка облачно, 40%    5
  ... ... ... ... ... ... ...
  7118    2021-10-03 06:17:52 4   1035    61  Clouds : облачно с прояснениями, 63%    2.08
  7119    2021-10-03 12:18:14 10  1034    44  Clouds : облачно с прояснениями, 69%    2.1
  7120    2021-10-03 18:17:42 5.19    1035    58  Rain : небольшой дождь, 100%    1.9
  7121    2021-10-04 00:17:48 3.65    1036    71  Clouds : пасмурно, 98%  1.77
  7122    2021-10-04 06:17:20 5.81    1037    71  Clouds : облачно с прояснениями, 55%    2.98
  </code></pre>
  <p>The data is collected independently, so the dates in the tables are different.
  I need to append to each row in df1 the row from df2 closest in datetime ( min(abs(date_p-date_w)) to match (sync) traffic and proper weather data in time) in order to get final table:</p>
  <pre><code>id  mtm_id  date_p  travel_d    ut_p    travel_t date_w temperature pressure    humidity    clouds  wind_speed
  </code></pre>
  <p>I can do it in standard way with loops, but I'm wondering if there is any python-elegant way to do this in vector operations rather than step by step (I'm sure python gurus can do everything!))). It's also a question of speed of code execution, which also matters.</p>
  <p>Thank in advance.</p>