python - line interpolation on grid with python3 -


i new python(say 1 week) , numpy/scipy not new programming @ wondering how following correctly (preferably numpy/scipy):

so have 150x200 ndarray float values. want interpolate line 20:40 100:150 500 points in between.

getting x:y interpolation have with:

xvalues = numpy.linspace(20,100,500) yvalues = numpy.linspace(40,150,500) 

but how values(on line only) interpolated using numpy/scipy?

ps use python3

check out scipy.interpolate

import numpy np 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) 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -