diff options
| author | zhang <zch921005@126.com> | 2022-08-06 21:43:18 +0800 |
|---|---|---|
| committer | zhang <zch921005@126.com> | 2022-08-06 21:43:18 +0800 |
| commit | 1a83481394812c9f8dbebd60a04b3b66655cd01b (patch) | |
| tree | 2dfae87852dfe4d3c0a4b08e6d73aa09c1eedc22 /numerical/scipy_interp.py | |
| parent | 6ff967aaa317073b43c8764386823191cdf8656c (diff) | |
finance
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)) |
