Evaluate a 2-D Hermite_e series at points (x,y) with 3D array of coefficient using NumPy in Python
Last Updated :
03 Jun, 2022
In this article, we will cover how to evaluate a 2-D Hermite_e series at points (x,y) with a 3D array of coefficients using NumPy in Python.
np.polynomial.hermite_e.hermeval2d method
The np.polynomial.hermite_e.hermeval2d from the NumPy library is used to Evaluate a 2-D Hermite_e series at points(x,y) in Python. If the parameters x and y are tuples or lists, they are converted to arrays otherwise they are treated as scalars and must have the same shape after conversion. In either case, x and y or their elements must support multiplication and addition with themselves as well as with the elements of c. If c is a one-dimensional array, a one is implicitly appended to its shape to make it two-dimensional. The final shape will be c.shape[2:] + x.shape.
Syntax: np.polynomial.hermite_e.hermeval2d(x, y, c)
Parameters :
- x , y: array like compatible objects.
- c: array like object.
Returns : The values of the two-dimensional polynomial at coordinates formed by corresponding pairs of x and y values.
Example 1:
The NumPy package is imported. An array is created which represents a 3D array of coefficients of the Hermite series. np.polynomial.hermite_e.hermeval2d(x, y, c) is used to evaluate a 2-D Hermite series, in the below example, arrays are given for x and y parameters which represent multiple points. The shape, datatype, and dimension of the array are found by using the .shape, .dtype, and .ndim attributes.Â
Python3
# import packages
import numpy as np
from numpy.polynomial import hermite_e as mit
# array of coefficients
array = np.array([[[5,6],[7,8],[9,10]]])
print(array)
# shape of the array is
print("Shape of the array is : ",array.shape)
# dimension of the array
print("The dimension of the array is : ",array.ndim)
# evaluating a 2-d hermite series at point(x,y)
# with 3D coeffiecients
print(mit.hermeval2d([1,1],[2,2],array))
Output:
[[[ 5 6]
[ 7 8]
[ 9 10]]]
Shape of the array is : (1, 3, 2)
The dimension of the array is : 3
[[46. 46.]
[52. 52.]]
Example 2:
The NumPy package is imported. An array is created using np.arange(12).reshape(2, 2, 3) which represents a 3D array of coefficients of the Hermite series. np.polynomial.hermite_e.hermeval2d(x, y, c) is used to evaluate a 2-D Hermite series, The shape, datatype, and dimension of the array are found by using the .shape, .dtype, and .ndim attributes.Â
Python3
# import packages
import numpy as np
from numpy.polynomial import hermite_e as mit
# array of coefficients
array = np.arange(12).reshape(2, 2, 3)
print(array)
# shape of the array is
print("Shape of the array is : ",array.shape)
# dimension of the array
print("The dimension of the array is : ",array.ndim)
# evaluating a 2-d hermite series at point(x,y)
# with 3D coeffiecients
print(mit.hermeval2d([1,1],[2,2],array))
Output:
[[[ 0 1 2]
[ 3 4 5]]
[[ 6 7 8]
[ 9 10 11]]]
Shape of the array is : (2, 2, 3)
The dimension of the array is : 3
[[30. 30.]
[36. 36.]
[42. 42.]]
Similar Reads
Evaluate a 2-D Hermite series at points (x,y) with 3D array of coefficient using NumPy in Python In this article, we'll look at how to evaluate a 2-dimensional Hermite series using NumPy in Python at an array of points x, and y with the 3-dimensional array. np.hermval2d method We are using the hermite.hermval2d() function from the Numpy module to evaluate a 2D Hermite series at locations (x, y)
2 min read
Evaluate 2-D Hermite series on the Cartesian product of x and y with 3d array of coefficient using NumPy in Python In this article, we will discuss how to Evaluate a 2-D Hermite series on the Cartesian product of x and y with a 3d array of coefficients in Python and NumPy. NumPy.polynomial.hermite.hermgrid2d method Hermite polynomials are significant in approximation theory because the Hermite nodes are used as
3 min read
Evaluate a 2D Laguerre series at points (x,y) with 1D array of coefficient using NumPy in Python In this article, we will Evaluate a 2D Laguerre series at points (x,y) with a 1D array of coefficient Laguerre.lagval2d method In Python, laguerre.lagval2d() is used to evaluate a 2D Laguerre series at points (x,y). where coefficient_array is the input NumPy 1D array with coefficients and points re
2 min read
Evaluate a 3D Laguerre series at points (x,y,z) with 4D array of coefficient using NumPy in Python In this article, we will evaluate a 3D Laguerre Series at points (x,y) with 4 dimensional array of coefficient in Python. laguerre.lagval3d() The laguerre.lagval3d() is used to evaluate a 3D Laguerre series at points (x,y) Â which returns the values of the multidimensional polynomial on points formed
2 min read
Evaluate 2-D Hermite series on the Cartesian product of x and y with 1d array of coefficient using NumPy in Python In this article, we will discuss how to Evaluate a 2-D Hermite series on the Cartesian product of x and y with a 1d array of coefficients in Python using NumPy. NumPy.polynomial.hermite.hermgrid2d method Hermite polynomials are significant in approximation theory because the Hermite nodes are used a
3 min read