- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Evaluate a Hermite series at multidimensional array of points x in Python

To evaluate a Hermite series at points x, use the hermite.hermval() method in Python Numpy. The 1st parameter, x, if x is a list or tuple, it is converted to an ndarray, otherwise it is left unchanged and treated as a scalar. In either case, x or its elements must support addition and multiplication with themselves and with the elements of c.

The 2nd parameter, C, an array of coefficients ordered so that the coefficients for terms of degree n are contained in c[n]. If c is multidimensional the remaining indices enumerate multiple polynomials. In the two dimensional case the coefficients may be thought of as stored in the columns of c.

The 3rd parameter, tensor, if True, the shape of the coefficient array is extended with ones on the right, one for each dimension of x. Scalars have dimension 0 for this action. The result is that every column of coefficients in c is evaluated for every element of x. If False, x is broadcast over the columns of c for the evaluation. This keyword is useful when c is multidimensional. The default value is True.

## Steps

At first, import the required library −

import numpy as np from numpy.polynomial import hermite as H

Create an array of coefficients −

c = np.array([1, 2, 3])

Display the array −

print("Our Array...

",c)

Check the Dimensions −

print("

Dimensions of our Array...

",c.ndim)

Get the Datatype −

print("

Datatype of our Array object...

",c.dtype)

Get the Shape −

print("

Shape of our Array object...

",c.shape)

Here, x is a 2D array −

x = np.array([[1,2],[3,4]])

To evaluate a Hermite series at points x, use the hermite.hermval() method in Python Numpy −

print("

Result...

",H.hermval(x,c))

## Example

import numpy as np from numpy.polynomial import hermite as H # Create an array of coefficients c = np.array([1, 2, 3]) # Display the array print("Our Array...

",c) # Check the Dimensions print("

Dimensions of our Array...

",c.ndim) # Get the Datatype print("

Datatype of our Array object...

",c.dtype) # Get the Shape print("

Shape of our Array object...

",c.shape) # Here, x is a 2D array x = np.array([[1,2],[3,4]]) # To evaluate a Hermite series at points x, use the hermite.hermval() method in Python Numpy print("

Result...

",H.hermval(x,c))

## Output

Our Array... [1 2 3] Dimensions of our Array... 1 Datatype of our Array object... int64 Shape of our Array object... (3,) Result... [[ 11. 51.] [115. 203.]]

- Related Articles
- Evaluate a Hermite series at points x with multidimensional coefficient array in Python
- Evaluate a Hermite series at array of points x in Python
- Evaluate a Laguerre series at multidimensional array of points x in Python
- Evaluate a Legendre series at multidimensional array of points x in Python
- Evaluate a Hermite series at points x in Python
- Evaluate a Hermite series at tuple of points x in Python
- Evaluate a Hermite series at list of points x in Python
- Evaluate a Laguerre series at points x with multidimensional coefficient array in Python
- Evaluate a Hermite_e series at points x with multidimensional coefficient array in Python
- Evaluate a 2-D Hermite series at points (x,y) in Python
- Evaluate a 3-D Hermite series at points (x,y,z) in Python
- Evaluate a 2-D Hermite series at points (x,y) with 1D array of coefficient in Python
- Evaluate a 2-D Hermite series at points (x,y) with 3D array of coefficient in Python
- Evaluate a Laguerre series at array of points x in Python
- Evaluate a Legendre series at array of points x in Python