line interpolation on grid with python3
Question: I am very new to python(say 1 week) and numpy/scipy but not new to programming
at all but wondering how to do the following correctly (preferably with
numpy/scipy):

So say I have an 150x200 ndarray with float values. I want to interpolate a
line from 20:40 to 100:150 with 500 points in between.

Getting the x:y interpolation I have with:

    
    
    xValues = numpy.linspace(20,100,500)
    yValues = numpy.linspace(40,150,500)
    

But now how i get the values(on that line only) interpolated using
numpy/scipy?

PS I use python3


Answer: Check out
[Scipy.interpolate](http://docs.scipy.org/doc/scipy/reference/interpolate.html)

    
    
    import numpy as np
    from scipy.interpolate import interp1d
    xValues = numpy.linspace(20,100,500)
    yValues = numpy.linspace(40,150,500)
    f = interpolate.interp1d(x, y)
    
    xnew = np.arange(20, 30, 0.1)
    ynew = f(xnew)
    

