This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / polymul

_ArrayFunctionDispatcher

numpy:polymul

source: /dev/numpy/build-install/usr/lib/python3.14/site-packages/numpy/lib/_polynomial_impl.py :921

Signature

def   polymul ( a1 a2 )

Summary

Find the product of two polynomials.

Extended Summary

Finds the polynomial resulting from the multiplication of the two input polynomials. Each input must be either a poly1d object or a 1D sequence of polynomial coefficients, from highest to lowest degree.

Parameters

a1, a2 : array_like or poly1d object

Input polynomials.

Returns

out : ndarray or poly1d object

The polynomial resulting from the multiplication of the inputs. If either inputs is a poly1d object, then the output is also a poly1d object. Otherwise, it is a 1D array of polynomial coefficients from highest to lowest degree.

Examples

import numpy as np
np.polymul([1, 2, 3], [9, 5, 1])
Using poly1d objects:
p1 = np.poly1d([1, 2, 3])
p2 = np.poly1d([9, 5, 1])
print(p1)
print(p2)
print(np.polymul(p1, p2))

See also

convolve

Array convolution. Same output as polymul, but has parameter for overlap mode.

poly
poly1d

A one-dimensional polynomial class.

polyadd
polyder
polydiv
polyfit
polyint
polysub
polyval

Aliases

  • numpy.polymul

Referenced by