Evaluate a Hermite_e series at points x in using NumPy Python
Last Updated :
03 Jun, 2022
In this article, we will cover how to evaluate a Hermite_e series at points x using NumPy in Python.
numpy.polynomial.hermite.hermval
The numpy.polynomial.hermite.hermval() method from the NumPy library is used to evaluate a Hermite series at points x. If the parameter x is a tuple or a list, it is turned into an array otherwise, it is regarded as a scalar but, the parameter x should support multiplication and addition within itself and with the elements of c. If c is a 1-D array, then it will have the same shape as x. If c is multidimensional, then the shape of the result depends on the value of the tensor.
Syntax: numpy.polynomial.hermite.hermval
Parameters:
- x: array like object.
- c: Array of coefficients
- tensor: optional value, boolean type.
Returns: ndarray of Hermite_e series
Example 1:
The NumPy package is imported. An array is created which represents coefficients of the Hermite series. polynomial.hermite.hermval() is used to evaluate a Hermite series at point x. The shape, datatype, and dimension of the array are found by using the .shape, .dtype, and .ndim attributes. In this example, x is a scalar.
Python3
import numpy as np
from numpy.polynomial import hermite as H
# array of coefficients
array = np.array([5,6,7,8])
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 hermite series at points x
print(H.hermval(1,array))
Output:
[5 6 7 8]
Shape of the array is : (4,)
The dimension of the array is : 1
-1.0
Example 2:
The NumPy package is imported. An array is created using NumPy, which represents coefficients of the Hermite series. polynomial.hermite.hermval() is used to evaluate a Hermite series at a point x, where x is [1,2]. The shape, datatype, and dimension of the array are found by using the .shape, .dtype, and .ndim attributes. x is a list.
Python3
import numpy as np
from numpy.polynomial import hermite as H
# array of coefficients
array = np.array([5,6,7,8])
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 hermite series at points x
print(H.hermval([1,2],array))
Output:
[5 6 7 8]
Shape of the array is : (4,)
The dimension of the array is : 1
[ -1. 447.]
Similar Reads
Evaluate a 2-D Hermite_e series at points (x,y) using NumPy in Python In this article, we will cover how to evaluate a 2-D Hermite_e series at points (x,y) in Python. polynomial.hermite.hermval2d The numpy.polynomial.hermite.hermval2d() 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 l
3 min read
Evaluate a 2-D Hermite series at points (x,y) in using NumPy Python In this article, we will Evaluate a 2D Hermite series at points (x,y) in Numpy using python. hermite.hermval2d method In Python, To evaluate a Hermite series at points x with a multidimensional coefficient array, NumPy provides a function called hermite.hermval(), But to evaluate  2D Hermite series,
3 min read
Evaluate a Hermite_e series at list of points x using NumPy in Python In this article, we will be looking toward the approach to evaluating a Hermite_e series at a list of points x using Python and NumPy. Example: List: [6,7,8,9,10] Result: [102175. 191631. 329175. 529399. 808815.] Explanation: Hermite_e series at points x.NumPy.polynomial.hermite_e.hermeval() method
3 min read
Evaluate a Hermite_e series at list of points x using NumPy in Python In this article, we will cover how to evaluate a Hermite_e series at the list of points x using NumPy in Python. numpy.polynomial.hermite.hermval To evaluate a Hermite series at points x with a multidimensional coefficient array, NumPy provides a function called hermite.hermval(). It takes two param
3 min read
Evaluate a Hermite series at list of points x using NumPy in Python In this article, we will be looking toward the approach to evaluating a Hermite series at a list of points x in Python and NumPy. Example: List: [6,7,8,9,10] Result: [102175. 191631. 329175. 529399. 808815.] Explanation: Hermite series at points x.NumPy.polynomial.hermite.hermval() method To evaluat
2 min read
Evaluate a Hermite_e series at tuple of points x in Python In this article, we will be looking toward the approach to evaluating a Hermite_e series at a tuple of points x using Python and NumPy. Example: Tuple: (6,7,8,9,10) Result: [102175. 191631. 329175. 529399. 808815.] Explanation: Hermite_e series at points x.NumPy.polynomial.hermite_e.hermeval() metho
2 min read