Artificial intelligent assistant

データの補間を行って対応する値を出力したい YX Y0.3X X=[0.01 0.1 0.5 1. 2. 3. 4. 5. 6. 7. ] Y=[0.043675 0.041689 0.033546 0.027305 0.020843 0.016325 0.014061 0.0122960.011067 0.010214] ![]( ① ② ① plt.scatter(LAI,toc_red) plt.plot(LAI,toc_red) plt.xlabel("X") plt.ylabel('Y') ② x_latent = np.linspace(min(LAI), max(LAI), 100) from scipy import interpolate ip= ["", interpolate.interp1d] for method_name, method in [ip]: print(method_name) fitted_curve = method(LAI, toc_red) plt.scatter(LAI, toc_red, label="observed") plt.plot(x_latent, fitted_curve(x_latent), c="red", label="fitted") plt.grid() plt.legend() plt.show()

scipy`interpolate.interp1d`
`f_1d``y=f_1d(x)`


from scipy.interpolate import interp1d

X = [0.01, 0.1, 0.5, 1., 2., 3., 4., 5., 6., 7., ]
Y = [0.043675, 0.041689, 0.033546, 0.027305, 0.020843, 0.016325, 0.014061, 0.012296, 0.011067, 0.010214]

f_1d = interp1d(X, Y)
y = f_1d(0.3)
print(float(y))
# => 0.0376175

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 4c14b2fdae9ed9a03c4a10447e7103ce