Evaluate a Hermite_e series at points x with multidimensional coefficient array in Python
Last Updated :
22 Apr, 2022
In this article, we will cover how to evaluate a Hermite_e series at points x with a multidimensional coefficient array in Python using NumPy.
Example
Input: [[0 1]
[2 3]]
Output: [[ 6. 2.]
[10. 4.]]
Explanation: Hermite_e series at input points.
hermite_e.hermeval method
To evaluate a Hermite series at points x with a multidimensional coefficient array, NumPy provides a function called hermite_e.hermeval(). It takes two parameters x and c. whereas x is a tuple or list and c is an array of coefficients. This method is available in the hermite_e module in python, it returns a Hermite_e series at the given input points, Below is the syntax of the hermeval method.
Syntax: hermite_e.hermeval(x, c, tensor)
Parameter:
- x: a list or tuple
- c: an array of coefficients ordered
- tensor: boolean, optional
Return: Hermite_e series at points x
Example 1:
In this example, we are creating a coefficient of a multi-dimensional array with 5 elements and displaying the shape and dimensions of the array. After that, we are evaluating the Hermite_e series at points [4,1].
Python3
# import the numpy module
import numpy
# import hermite_se
from numpy.polynomial import hermite_e
# create array of coefficients with 5 elements each
coefficients_data = numpy.array([[1, 2, 3, 4, 5],
[3, 4, 2, 6, 7]])
# Display the coefficients
print(coefficients_data)
# get the shape
print(f"\nShape of an array: {coefficients_data.shape}")
# get the dimensions
print(f"Dimension: {coefficients_data.ndim}")
# Evaluate a Hermite_e series at points - [4,1]
print("\nHermite_e series", hermite_e.hermeval(
[4, 1], coefficients_data))
Output:
[[1 2 3 4 5]
[3 4 2 6 7]]
Shape of an array: (2, 5)
Dimension: 2
Hermite_e series [[13. 4.]
[18. 6.]
[11. 5.]
[28. 10.]
[33. 12.]]
Example 2:
In this example, we are creating a coefficient of a multi-dimensional array with NumPy of shape 2x2 and displaying the shape and dimensions of the array. After that, we are evaluating the Hermite_e series at points [3,1].
Python3
# import the numpy module
import numpy
# import hermite_se
from numpy.polynomial import hermite_e
# create array of coefficients with 5 elements each
coefficients_data = np.arange(4).reshape(2,2)
# Display the coefficients
print(coefficients_data)
# get the shape
print(f"\nShape of an array: {coefficients_data.shape}")
# get the dimensions
print(f"Dimension: {coefficients_data.ndim}")
h = [3,1]
# Evaluate a Hermite_e series at points - [3,1]
print("\nHermite_e series", hermite_e.hermeval(
h,coefficients_data))
Output:
[[0 1]
[2 3]]
Shape of an array: (2, 2)
Dimension: 2
Hermite_e series [[ 6. 2.]
[10. 4.]]
Similar Reads
Evaluate a Hermite_e series at points x when coefficients are multi-dimensional in Python In this article, we will discuss how to evaluate a Hermite_e series at points x when coefficients are multi-dimensional in Python We use the hermite.hermeval() function from the numpy module. Syntax: hermite_e.hermeval(x,Arr) Parameters : x (required parameter): 'x' can be a single number or list of
2 min read
Evaluate a 2-D Hermite_e series at points (x,y) with 3D array of coefficient using NumPy in Python 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,
3 min read
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
Differentiate a Hermite series with multidimensional coefficients in Python In this article, we will cover how to differentiate a Hermite series with multidimensional coefficients in Python using NumPy. Example Input: [[ 1 Â 2 Â 3 Â 4 Â 5] Â [ 3 Â 4 Â 2 Â 6 Â 7] Â [43 45 Â 2 Â 6 Â 7]] Output: [[ Â 3. Â 4. Â 2. Â 6. Â 7.] Â [129. 135. Â 6. Â 18. Â 21.]] Explanation: Hermite series of the der
3 min read
Evaluate Hermite series at points x when coefficients are multi-dimensional using NumPy in Python In this article, we will cover how to evaluate a Hermite series at points x with a multidimensional coefficient array in Python using NumPy. Example Input: [[11 12][13 14]] Output: [[37. 63.][40. 68.]] Explanation: Hermite series at points x.NumPy.polynomial.hermite.hermval method To evaluate a Herm
3 min read