运行 ❯
获取您
自己的 Python
服务器
×
改变方向
改变主题,深色/浅色
前往 Spaces
from scipy.interpolate import UnivariateSpline import numpy as np xs = np.arange(10) ys = xs**2 + np.sin(xs) + 1 interp_func = UnivariateSpline(xs, ys) newarr = interp_func(np.arange(2.1, 3, 0.1)) print(newarr)
[ 5.62826474 6.03987348 6.47131994 6.92265019 7.3939103 7.88514634 8.39640439 8.92773053 9.47917082]