如何提供np.polynomial.Chebyshev
系数?我发现API不直观。看起来它假设有一些系数值
> import numpy as np
> xf = 3
> P = np.polynomial.Chebyshev([0, xf]) # domain is [0, xf]
> P(np.linspace(0, 3, 5)) # evaluate at 5 x-points evenly spaced from 0 to 3
array([0. , 2.35619449, 4.71238898, 7.06858347, 9.42477796])
P(np.linspace(0, 3, 5), [1,2,3]) # evaluate the points with prescribed coefficients, implicitly asking for polynomials of 4 degrees
TypeError: __call__() takes exactly 2 arguments (3 given)
答案 0 :(得分:1)