title: Pandas find the nearest value for in a column
body: <p>I have the following table:</p>
  <pre><code>   year   pop1     pop2
  0   0    100000    100000
  1   1    999000    850000
  2   2    860000    700000
  3   3    770000    650000
  </code></pre>
  <p>I want to find for each pop (pop1 ,pop2) the year the pop was closest to a given number, for example, the year the pop was the closest to 830000.</p>
  <p>Is there any way to find the nearest value inside column based on given value?</p>
  <p>I have seen this post (<a href="https://stackoverflow.com/questions/30112202/how-do-i-find-the-closest-values-in-a-pandas-series-to-an-input-number">How do I find the closest values in a Pandas series to an input number?</a>_ but seems like here the result is above and below and I wat to get in the end only one number.</p>
  <p>*I don't have code example because I don't find any argument to use to get the nearest</p>