title: how to match two numpy array of unequal length?
body: <p>i have two 1D numpy arrays. The lengths are unequal. I want to make pairs (array1_elemnt,array2_element) of the elements which are close to each other. Lets consider following example</p>
  
  <pre><code>    a = [1,2,3,8,20,23]
      b = [1,2,3,5,7,21,35]
  </code></pre>
  
  <p>The expected result is</p>
  
  <pre><code>    [(1,1), 
      (2,2), 
      (3,3), 
      (8,7),
      (20,21),
      (23,25)]
  </code></pre>
  
  <p>It is important to note that 5 is left alone. It could easily be done by loops but I have very large arrays. I considered using nearest neighbor. But felt like killing a sparrow with a canon. </p>
  
  <p>Can anybody please suggest any elegant solution.</p>
  
  <p>Thanks a lot.</p>