I am trying to compute the coefficients of the kth Chebyshev polynomial. Let's just set k to 5 for this. So far, I have the following:
a = (0,0,0,0,0,1) #selects the 5th Chebyshev polynomial
p = numpy.polynomial.chebyshev.Chebyshev(a) #type here is Chebyshev
cpoly = numpy.polynomial.chebyshev.cheb2poly(p) #trying to convert to Poly
print cpoly.all_coeffs()
After the second line runs, I have an object of type Chebyshev
, as expected. However, the third line fails to convert to a type Poly
, and converts to type numpy.ndarray
. Thus, I get an error saying that ndarray has no attribute all_coeffs
.
Anyone know how to fix this?