numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
polydiv(u, v)
note

This forms part of the old polynomial API. Since version 1.4, the new polynomial API defined in :None:None:`numpy.polynomial` is preferred. A summary of the differences can be found in the :None:doc:`transition guide </reference/routines.polynomials>`.

The input arrays are the coefficients (including any coefficients equal to zero) of the "numerator" (dividend) and "denominator" (divisor) polynomials, respectively.

Notes

Both u and v must be 0-d or 1-d (ndim = 0 or 1), but :None:None:`u.ndim` need not equal :None:None:`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.

Parameters

u : array_like or poly1d

Dividend polynomial's coefficients.

v : array_like or poly1d

Divisor polynomial's coefficients.

Returns

q : ndarray

Coefficients, including those equal to zero, of the quotient.

r : ndarray

Coefficients, including those equal to zero, of the remainder.

Returns the quotient and remainder of polynomial division.

See Also

poly
polyadd
polyder
polydiv
polyfit
polyint
polymul
polysub
polyval

Examples

$$\frac{3x^2 + 5x + 2}{2x + 1} = 1.5x + 1.75, remainder 0.25$$
>>> 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]))
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.polynomial.polynomial.polymul scipy.signal._signaltools.deconvolve numpy.polynomial.polynomial.polypow numpy.polynomial.polynomial.polysub numpy.polymul numpy.polynomial.polynomial.polymulx numpy.polydiv numpy.polyadd numpy.polysub numpy.polynomial.polynomial.polyadd

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/lib/polynomial.py#976
type: <class 'function'>
Commit: