Issue
Let's say I have a list of coefficients [1,2,3]
. How do I convert this to x^3 + 2x^2 + 3
or something similar in NumPy? Is it even possible?
Solution
As described in the docs, which I recommend reading:
>>> p1 = np.polynomial.Polynomial([3, 2, 1])
>>> p1
Polynomial([3., 2., 1.], domain=[-1, 1], window=[-1, 1])
>>> p1(0)
3.0
Note that the order of coefficients is reversed.
Answered By - Dominik StaĆczak
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.