numpy.polydiv

numpy.polydiv(u, v)[源代码]

返回多项式除法的商和余数。

注解

这是旧的多项式API的一部分。从版本1.4开始,新的多项式API在 numpy.polynomial 首选。差异可以在摘要中找到 transition guide .

输入数组分别是“分子”(被除数)和“分母”(除数)多项式的系数(包括任何等于零的系数)。

参数
u数组或poly1d

被除数多项式系数。

v数组或poly1d

除数多项式系数。

返回
q恩达雷

商的系数,包括等于零的系数。

r恩达雷

余数的系数,包括等于零的系数。

笔记

两个 uv 必须是0-d或1-d(ndim=0或1),但 u.ndim 不平等 v.ndim . 换句话说,所有四种可能的组合- u.ndim = v.ndim = 0u.ndim = v.ndim = 1u.ndim = 1, v.ndim = 0u.ndim = 0, v.ndim = 1 -工作。

实例

System Message: WARNING/2 (\压裂3x^2+5x+2 2x+1=1.5x+1.75,剩余0.25)

latex exited with error [stdout] This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=latex) restricted \write18 enabled. entering extended mode (./math.tex LaTeX2e <2018-12-01> (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2018/09/03 v1.4i Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo)) (/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amscls/amsthm.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/anyfontsize/anyfontsize.sty) (/usr/share/texlive/texmf-dist/tex/latex/tools/bm.sty) (./math.aux) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) ! Undefined control sequence. <argument> \split@tag \begin {split}\� ��裂3x^2+5x+2 2x+1=1.5x+1.75,剩余... l.14 ...x+2 2x+1=1.5x+1.75,剩余0.25\end{split} ! Package inputenc Error: Invalid UTF-8 byte "8E. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...x+2 2x+1=1.5x+1.75,剩余0.25\end{split} ! Package inputenc Error: Invalid UTF-8 byte "8B. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...x+2 2x+1=1.5x+1.75,剩余0.25\end{split} ! Package inputenc Error: Unicode character 裂 (U+88C2) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...x+2 2x+1=1.5x+1.75,剩余0.25\end{split} ! Package inputenc Error: Unicode character , (U+FF0C) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...x+2 2x+1=1.5x+1.75,剩余0.25\end{split} ! Package inputenc Error: Unicode character 剩 (U+5269) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...x+2 2x+1=1.5x+1.75,剩余0.25\end{split} ! Package inputenc Error: Unicode character 余 (U+4F59) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...x+2 2x+1=1.5x+1.75,剩余0.25\end{split} ! Undefined control sequence. <argument> \split@tag \begin {split}\� ��裂3x^2+5x+2 2x+1=1.5x+1.75,剩余... l.14 ...x+2 2x+1=1.5x+1.75,剩余0.25\end{split} ! Package inputenc Error: Invalid UTF-8 byte "8E. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...x+2 2x+1=1.5x+1.75,剩余0.25\end{split} ! Package inputenc Error: Invalid UTF-8 byte "8B. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...x+2 2x+1=1.5x+1.75,剩余0.25\end{split} ! Package inputenc Error: Unicode character 裂 (U+88C2) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...x+2 2x+1=1.5x+1.75,剩余0.25\end{split} ! Package inputenc Error: Unicode character , (U+FF0C) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...x+2 2x+1=1.5x+1.75,剩余0.25\end{split} ! Package inputenc Error: Unicode character 剩 (U+5269) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...x+2 2x+1=1.5x+1.75,剩余0.25\end{split} ! Package inputenc Error: Unicode character 余 (U+4F59) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.14 ...x+2 2x+1=1.5x+1.75,剩余0.25\end{split} [1] (./math.aux) ) (see the transcript file for additional information) Output written on math.dvi (1 page, 388 bytes). Transcript written on math.log.

>>> 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]))