summaryrefslogtreecommitdiff
path: root/numerical/scipy_interp.py
diff options
context:
space:
mode:
authorzhang <zch921005@126.com>2022-08-06 21:43:18 +0800
committerzhang <zch921005@126.com>2022-08-06 21:43:18 +0800
commit1a83481394812c9f8dbebd60a04b3b66655cd01b (patch)
tree2dfae87852dfe4d3c0a4b08e6d73aa09c1eedc22 /numerical/scipy_interp.py
parent6ff967aaa317073b43c8764386823191cdf8656c (diff)
finance
Diffstat (limited to 'numerical/scipy_interp.py')
-rw-r--r--numerical/scipy_interp.py11
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))