title: 2D Nearest Neighbor Interpolation in Python
body: <p>Suppose that we have the following look up table</p>
  
  <pre><code>        | 1.23    2.63    4.74    6.43    5.64
   -------|--------------------------------------
   -------|--------------------------------------
   2.56   |  0       0      1        0       1
   4.79   |  0       1      1        1       0
   6.21   |  1       0      0        0       0
  </code></pre>
  
  <p>This table contains a labeling matrix (having only <code>0</code> and <code>1</code>s), <code>x</code> values and <code>y</code> values. How one can have <strong>nearest-neighbor interpolation</strong> for this look up table?</p>
  
  <p><strong>Example:</strong></p>
  
  <pre><code>Input: (5.1, 4.9)
  Output: 1
  
  Input: (3.54, 6.9)
  Output: 0
  </code></pre>