scipy.interpolate中的interp2d

a = np.array([[1, 2], [2, 3]])
interObj = interpolate.interp2d([0, 2], [0, 2], a)
rst = interObj(range(3), range(3))
print(a)
print(rst)
[[1 2]
 [2 3]]
[[1.  1.5 2. ]
 [1.5 2.  2.5]
 [2.  2.5 3. ]]

猜你喜欢

转载自blog.csdn.net/w112348/article/details/114198130