| [ Web Proxy ] |
| Viewing: https://numpy.org/doc/stable/reference/generated/../generated/../generated/numpy.polydiv.html | [Back] [Original] |
Returns the quotient and remainder of polynomial division.
Note
This forms part of the old polynomial API. Since version 1.4, the
new polynomial API defined in numpy.polynomial is preferred.
A summary of the differences can be found in the
transition guide.
The input arrays are the coefficients (including any coefficients equal to zero) of the numerator (dividend) and denominator (divisor) polynomials, respectively.
Dividend polynomials coefficients.
Divisor polynomials coefficients.
Coefficients, including those equal to zero, of the quotient.
Coefficients, including those equal to zero, of the remainder.
Notes
Both u and v must be 0-d or 1-d (ndim = 0 or 1), but u.ndim need
not equal v.ndim. In other words, all four possible combinations -
u.ndim = v.ndim = 0, u.ndim = v.ndim = 1,
u.ndim = 1, v.ndim = 0, and u.ndim = 0, v.ndim = 1 - work.
Examples
>>> import numpy as np
>>> x = np.array([3.0, 5.0, 2.0])
>>> y = np.array([2.0, 1.0])
>>> np.polydiv(x, y)
(array([1.5 , 1.75]), array([0.25]))
| Web Proxy Viewer | New URL | Original Page |