Numpy数组自身加和与乘积运算
http://www.weixueyuan.net/a/794.html
python-scipy -hermite插值,分段三次Hermite插值
import numpy as np
import xlrd
import pandas as pd
import matplotlib.pyplot as plt
from scipy import interpolate
def PiecewiseCubicHermiteInterpolatingPolynomial():
# print('numpy : ' + np.__version__)
# print('scipy :' + __version__)
x = np.arange(10)
y = [1., 1., 3., 2., 1., 1., 1.5, 2., 8., 1.]
f = interpolate.PchipInterpolator(x, y, axis=0, extrapolate=None)#Pchip:三次Hermite插值
print(f.roots()) # this produces an error !
xnew = np.arange(0, 9, 0.1)
ynew = f(xnew) # use interpolation function returned by `PchipInterpolator`
L1,L2,=plt.plot(x, y, 'o',xnew, ynew, '-')
plt.legend([L1,L2],['spot','3hermit'])
plt.show()
PiecewiseCubicHermiteInterpolatingPolynomial()
上面一个是三次hermite样条