title: scipy.optimise.bisect on a numpy array
body: <p>I have a numpy array of floats which when printed look like this:
  <a href="https://i.stack.imgur.com/dF3LI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dF3LI.png" alt="enter image description here"></a> </p>
  
  <p>The red circles are the original values, the blue crosses are a linear interpolation using <code>numpy.interp</code>. </p>
  
  <p>I would like to find the abscissa of the zero crossing of this numpy array (red circle) using <code>scipy.optimize.bisect</code> (for example). Since this is a numpy array (and not a function) I cannot pass it directly to <code>scipy.optimize.bisect</code>. So I was thinking to pass a function that interpolates the numpy array to bisect. Here is the code I am using for the moment:</p>
  
  <pre><code>def Inter_F(x,xp,fp):
      return np.interp(x,xp,fp)
  Numpyroot = scp.optimize.bisect(Inter_F,0,9,args=(XNumpy,YNumpy)) 
  </code></pre>
  
  <p>I find a value that seems correct, Numpyroot = 3.376425289196618.<br>
  I am wondering:</p>
  
  <ul>
  <li>if this is the correct technical way to use scipy.optimize.bisect on
     a numpy array? Specially when I am going to do this 10^6 times on different set of numpy values.</li>
  <li>if enforcing a linear interpolation is not influencing the results
  that bisect is going to find and if yes, are there better choice?</li>
  </ul>
  
  <p>Here are the two numpy arrays:</p>
  
  <pre><code>XNumpy = array([ 0.   ,  1.125,  2.25 ,  3.375,  4.5  ,  5.625,  6.75 ,  7.875,  9.   ])
  YNumpy = array([ -2.70584242e+04,  -2.46925289e+04,  -1.53211676e+04,
          -2.30000000e+01,   1.81312104e+04,   3.41662461e+04,
           4.80466863e+04,   5.75113178e+04,   6.41718009e+04])
  </code></pre>