title: Extract information from closest timestamp in separate dataframe pandas
body: <p>I have two dataframes, one is a continuous data(taken every 15 seconds) from a buoy in a fixed location and the other is observation data taken at many different time intervals in different places. Both have consistent timestamps in their respective dataframes. For every observation I need to take the timestamp of the observation and find the closest timestamp in the continuous dataframe, extract information from that row, and add it to the observation. I am having a hard time finding a way to find the closest timestamp in the continuous data with my series. </p>
  
  <p>Observation data:</p>
  
  <pre><code>   counter    depth  latdeg   latmin     latdec  londeg  lonmin    ts
  0      100001   21.110      72  18.5412  72.309020    -148 -47.071 2018-03-20 17:21:49+01:00
  1      100002   22.140      72  18.5448  72.309080    -148 -47.0785 2018-03-20 17:22:07+01:00
  2      100003   45.300      72  18.5396  72.308993    -148 -47.0936 2018-03-20 17:34:38+01:00
  3      100004   45.310      72  18.5360  72.308933    -148 -47.0974 2018-03-20 17:36:31+01:00
  </code></pre>
  
  <p>Continuous data:</p>
  
  <pre><code>    sec sat lat long    alt time
  4164    62460   9   72.31061472 -148.790606 -6.9809 2018-03-20 17:21:00+01:00
  4165    62475   9   72.31061655 -148.7906147    -7.0923 2018-03-20 17:21:15+01:00
  4166    62490   9   72.31061099 -148.7906154    -7.7008 2018-03-20 17:21:30+01:00
  4167    62505   9   72.31060295 -148.7906237    -8.3746 2018-03-20 17:21:45+01:00
  4168    62520   9   72.31059877 -148.7906251    -7.5989 2018-03-20 17:22:00+01:00
  </code></pre>
  
  <p>so for example I would like to take <code>obs[0]['ts']</code> and find the index of the closest time in <code>cont['time']</code>, which would be <code>4167</code>, to then append the lat long and alt to the observation dataframe. </p>