I have two arrays x, y with coordinates of a function.
Example:
x=[0,1,2,3,4,5]
y=[0,1,5,20,30,32]
pylab.plot(x,y) shows me a smooth function for this.
Is there a way to get the x-Value for y=3?
regards
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should be able to use
numpy.interpfor this.e.g.:
Note that this only works since your y values are monotonic. If your y-values aren’t monotonic, there is no guarantee that your mapping of y->x is unique.