diff options
Diffstat (limited to 'numerical/scipy_interp.py')
| -rw-r--r-- | numerical/scipy_interp.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/numerical/scipy_interp.py b/numerical/scipy_interp.py new file mode 100644 index 0000000..fb7d3e8 --- /dev/null +++ b/numerical/scipy_interp.py @@ -0,0 +1,11 @@ +import numpy as np + +from scipy import interpolate +x = np.asarray(range(2)) +y = np.asarray(range(2)) +z = np.asarray([[10, 40], [30, 20]]) +f = interpolate.interp2d(x, y, z, kind='linear') + +for x in range(6): + for y in range(6): + print(x, y, f(x, y)) |
