0
0
NumPydata~5 mins

Polynomial operations with np.poly in NumPy - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does np.poly do in NumPy?

np.poly returns the coefficients of a polynomial whose roots are given. It helps create a polynomial from its roots.

Click to reveal answer
beginner
How are polynomial coefficients ordered in NumPy arrays?

Coefficients are ordered from the highest degree term to the constant term. For example, [1, -3, 2] means 1*x^2 - 3*x + 2.

Click to reveal answer
intermediate
How to multiply two polynomials using NumPy?

Use np.polymul(p1, p2) where p1 and p2 are arrays of coefficients. It returns coefficients of the product polynomial.

Click to reveal answer
beginner
What function helps find the roots of a polynomial given its coefficients?

np.roots(coefficients) returns the roots of the polynomial defined by the given coefficients.

Click to reveal answer
intermediate
How to add two polynomials in NumPy?

Pad the shorter coefficient array with zeros on the left, then add element-wise. NumPy does not have a direct add function for polynomials.

Click to reveal answer
What does np.poly([1, 2, 3]) return?
ACoefficients of polynomial with roots 1, 2, 3
BRoots of polynomial with coefficients 1, 2, 3
CPolynomial evaluated at points 1, 2, 3
DDerivative of polynomial with roots 1, 2, 3
How are polynomial coefficients ordered in NumPy arrays?
AFrom highest degree to constant term
BRandom order
CFrom constant term to highest degree
DFrom lowest degree to highest degree
Which function multiplies two polynomials in NumPy?
Anp.polyadd
Bnp.polymul
Cnp.polydiv
Dnp.polyroots
What does np.roots([1, -3, 2]) return?
AIntegral of polynomial
BCoefficients of polynomial
CDerivative of polynomial
DRoots of polynomial x² - 3x + 2
How to add two polynomials in NumPy?
AUse np.polyadd
BUse np.polymul
CPad shorter array with zeros and add element-wise
DUse np.polydiv
Explain how to create a polynomial from its roots using NumPy.
Think about how roots relate to polynomial factors.
You got /4 concepts.
    Describe how to multiply two polynomials represented by coefficient arrays in NumPy.
    Multiplying polynomials is like multiplying their coefficient arrays.
    You got /3 concepts.