Python | Numpy np.polygrid2d() method (original) (raw)
Last Updated : 29 Dec, 2019
**np.polygrid2d()**
method is used to evaluate a 2-D polynomial series on the Cartesian product of x and y.
Syntax :
np.polygrid2d(x, y, c)
Parameters:
**x, y :**[array_like]The two dimensional series is evaluated at the points in the Cartesian product of x and y. If x or y is a list or tuple, it is first converted to an ndarray, otherwise it is left unchanged and, if it isn’t an ndarray, it is treated as a scalar.
**c :**[array_like]arrays of coefficient polynomial series.
Return : [ndarray] The values of the two dimensional polynomial series at points in the Cartesian product of x and y.
Code #1 :
import
numpy as np
from
numpy.polynomial.polynomial
import
polygrid2d
c
=
np.array([[
1
,
3
,
5
], [
2
,
4
,
6
]])
ans
=
polygrid2d([
7
,
9
], [
8
,
10
], c)
print
(ans)
Output:
[[ 3271. 5025.] [ 4107. 6309.]]
Code #2 :
import
numpy as np
from
numpy.polynomial.polynomial
import
polygrid2d
c
=
np.array([[
1
,
3
,
5
], [
2
,
4
,
6
]])
ans
=
polygrid2d(
7
,
8
, c)
print
(ans)
Similar Reads
- Python | Numpy np.polygrid3d() method np.polygrid3d() method is used to evaluate a 3-D polynomial series on the Cartesian product of x, y and z. Syntax : np.polygrid3d(x, y, z, c) Parameters: x, y, z :[array_like]The three dimensional series is evaluated at the points in the Cartesian product of x, y and z. If x or y or z is a list or t 2 min read
- Python | Numpy np.polyvander2d() method With the help of np.polyvander2d() method, we can get the Pseudo-Vandermonde matrix from given array having degree which is passed as parameter by using np.polyvander2d() method. Syntax : np.polyvander2d(x, y, deg) Parameters: x, y :[ array_like ] Array of points. The dtype is converted to float64 o 2 min read
- Python | Numpy np.polyvander() method np.polyvander() method is used to returns the Vandermonde matrix of degree deg and sample points x. Syntax : np.polyvander(x, deg) Parameters: x :[ array_like ] Array of points. The dtype is converted to float64 or complex128 depending on whether any of the elements are complex. If x is scalar it is 1 min read
- Python | Numpy np.polyvander3d() method np.polyvander3d() method is used to returns the Vandermonde matrix of degree deg and sample points x, y and z. Syntax : np.polyvander3d(x, y, z, deg) Parameters: x, y, z :[ array_like ] Array of points. The dtype is converted to float64 or complex128 depending on whether any of the elements are comp 2 min read
- numpy.polyadd() in Python numpy.polyadd() : This function helps to find the sum of two polynomials and then returning the result as a polynomial. Each input polynomial must be a sequence of polynomial coefficients, from highest to lowest degree. Parameters : p1 : Input polynomial 1 p2 : Input polynomial 2 Return : Sum of pol 1 min read
- numpy.poly1d() in Python The numpy.poly1d() function helps to define a polynomial function. It makes it easy to apply "natural operations" on polynomials. Syntax: numpy.poly1d(arr, root, var) Parameters : arr : [array_like] The polynomial coefficients are given in decreasing order of powers. If the second parameter (root) i 3 min read
- Python | Numpy np.fft2() method With the help of np.fft2() method, we can get the 2-D Fourier Transform by using np.fft2() method. Syntax : np.fft2(Array) Return : Return a 2-D series of fourier transformation. Example #1 : In this example we can see that by using np.fft2() method, we are able to get the 2-D series of fourier tran 1 min read
- numpy.poly() in Python The numpy.poly() function in the Sequence of roots of the polynomial returns the coefficient of the polynomial. Syntax :numpy.poly(seq) Parameters : Seq : sequence of roots of the polynomial roots, or a matrix of roots. Return: 1D array having coefficients of the polynomial from the highest degree t 2 min read
- numpy.polydiv() in Python The numpy.polydiv() method evaluates the division of two polynomials and returns the quotient and remainder of the polynomial division. Syntax : numpy.polydiv(p1, p2) Parameters : p1 : [array_like or poly1D]Coefficients of dividend polynomial. p2 : [array_like or poly1D]Coefficients of divisor polyn 1 min read
- numpy.polyder() in Python The numpy.polyder() method evaluates the derivative of a polynomial with specified order. Syntax :numpy.polyder(p, m) Parameters : p : [array_like or poly1D]the polynomial coefficients are given in decreasing order of powers. If the second parameter (root) is set to True then array values are the ro 2 min read