title: Check if float is close to any float stored in array
body: <p>I need to check if a given float is close, within a given tolerance, to <em>any float</em> in an array of floats.</p>
  
  <pre><code>import numpy as np
  
  # My float
  a = 0.27
  # The tolerance
  t = 0.01
  # Array of floats
  arr_f = np.arange(0.05, 0.75, 0.008)
  </code></pre>
  
  <p>Is there a simple way to do this? Something like <code>if a in arr_f:</code> but allowing for some tolerance in the difference?</p>
  
  <hr>
  
  <p><strong>Add</strong></p>
  
  <p>By "allow tolerance" I mean it in the following sense:</p>
  
  <pre><code>for i in arr_f:
      if abs(a - i) &lt;= t:
          print 'float a is in arr_f within tolerance t'
          break
  </code></pre>