Differentiate a Hermite_e series in Python
To Differentiate a Hermite series in python we use the NumPy.polynomial.hermite_e.hermeder() method which is used to return the c differentiated m times along the axis series coefficients. Where, the argument c is an array of coefficients ranging in degree from low to high along each axis, such as [4,3,5], which represents the series 4*He 0 + 3*He 1 + 5*He 2. Below is the syntax of the hermeder method.
Syntax: numpy.polynomial.hermite_e.hermeder(c, m=1, scl=1, axis=0)
- c: array like object. The coefficients of the Hermite e series are stored in an array. If c is multidimensional, the various axes correspond to various variables, with the degree in each axis being determined by the appropriate index.
- m: int , optional value. The total number of derivatives taken must not be negative. (Standard: 1).
- scl: scalar, optional value. scl is multiplied by each differentiation. Multiplication by scl**m is the end result. This is for when you want to make a linear change in a variable. (Standard: 1).
- axis: int , optional value. The axis on which the derivative is computed. (The default is 0).
Return: der: ndarray.The derivative of Hermite series.
Here, we will create a NumPy array and use numpy.polynomial.hermite_e.hermeder() to differentiate the Hermite series. The shape of the array is found by the .shape attribute, the dimension of the array is found by .ndim attribute, and the data type of the array is .dtype attribute.
[4 2 5] Shape of the array is : (3,) The dimension of the array is : 1 Datatype of our Array is : int64 [ 2. 10.]
In this example, we create a 2-d series and differentiate it along with the columns ( axis =1).
[[4 2 5] [1 4 2]] Shape of the array is : (2, 3) The dimension of the array is : 2 Datatype of our Array is : int64 [[10.] [ 4.]]