def ployfit( y, x=None, order = 20 ):
'''
fit data (one-d array) by a ploynominal function
return the fitted one-d array
'''
if x is None:
x = range(len(y))
pol = np.polyfit(x, y, order)
return np.polyval(pol, x)
评论列表
文章目录