How to get a approximate equation for reverse look up : Is there any method or way to get the approximate equation(x = g(y)) for doing a reverse lookup from Y to X. Following is the simple y = f(x) and it's plot.

```
import numpy as np
import matplotlib.pyplot as plt  
formula = "2*x**6 + x**5 -3*x**4 + 7*x**3 + 9*x**2 + x + 6"
x = np.arange(1, 10)
y = eval(formula)
plt.plot(x, y)
plt.xlabel('X')
plt.ylabel('Y')
plt.show()
```
[Attaching the simple graph here][1]


  [1]: https://i.stack.imgur.com/xIXXx.png

Can you please suggest me any possible way in R or Python to get reverse lookup function(From Y to X) with a minimal margin of error.