title: Solving for x values of polynomial with known y in scipy / numpy
body: <p>I am trying to solve for the x values with a known y. I was able to get the polynomial to fit my data, and now I want to know the x value that a chosen y would land on the curve.</p>
  
  <pre><code>import numpy as np
  
  x = [50, 25, 12.5, 6.25, 0.625, 0.0625, 0.01]
  y = [0.00, 0.50, 0.68, 0.77, 0.79, 0.90, 1.00]
  
  poly_coeffs = np.polyfit(x, y, 3)
  
  f = np.poly1d(poly_coeffs)
  </code></pre>
  
  <p>I want to do 0.5 = f and solve for the x values.</p>
  
  <p>I can solve this in WolframAlpha by typing: </p>
  
  <pre><code>0.5 = -9.1e-6*x^3 + 5.9e-4*x^2 - 2.5e-2*x + 9.05e-1
  </code></pre>
  
  <p>The real x value is ~26</p>