Evaluate a Hermite series at list of points x using NumPy in Python
Last Updated :
03 Jun, 2022
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 evaluate a Hermite series of a list of points at x, the user needs to call the hermite.hermval() method of the Numpy library in Python. Further, the user needs to pass the first parameter to the function which is the x, where x is a list or tuple, and the 2nd parameter is C, which is an array of coefficients.
Syntax : np.polynomial.hermite.hermval(x, c)
Parameter:
- x: list or tuple
- c: array of coefficient
Return : Return the coefficient of series after multiplication.
Example 1:
In this example, we created an array of 5 data points of one dimension and further created a list named x, after that we used the hermite.hermval() method and pass the required parameters to evaluate the Hermite series at a list of points [6,7,8,9,10].
Python3
import numpy as np
from numpy.polynomial import hermite
a = np.array([1,2,3,4,5])
# Dimensions of Array
print("Dimensions of Array: ",a.ndim)
# Shape of the array
print("\nShape of Array: ",a.shape)
# List
x = [6,7,8,9,10]
# To evaluate a Hermite series at points x
print("\nHermite series at point", hermite.hermval(x,a))
Output:
Dimensions of Array: 1
Shape of Array: (5,)
Hermite series at point [102175. 191631. 329175. 529399. 808815.]
Example 2:
In this example, we created a 2-D array of 10 data points and further created a list name x, after we used the hermite.hermval() method and pass the required parameters to evaluate the Hermite series at a list at points [11,12,13,14,15].
Python3
import numpy as np
from numpy.polynomial import hermite
a = np.array([[1,2,3,4,5],[6,7,8,9,10]])
# Dimensions of Array
print("Dimensions of Array: ",a.ndim)
# Shape of the array
print("\nShape of Array: ",a.shape)
# List
x = [11,12,13,14,15]
# To evaluate a Hermite series at points x
print("\nHermite series at point", hermite.hermval(x,a))
Output:
Dimensions of Array: 2
Shape of Array: (2, 5)
Hermite series at point [[133. 145. 157. 169. 181.]
[156. 170. 184. 198. 212.]
[179. 195. 211. 227. 243.]
[202. 220. 238. 256. 274.]
[225. 245. 265. 285. 305.]]
Similar Reads
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_e series at points x in using NumPy Python 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
2 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 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