Divide one Hermite series by another in Python using NumPy
Last Updated :
25 Apr, 2022
In this article, we are going to see how to divide one Hermite series by another in Python using NumPy.
The numpy hermdiv() method helps us divide one Hermite series by another. The quotient and remainder of two Hermite series, c1 / c2, are returned. The arguments are a series of coefficients from lowest to highest order "term," for example, [1,4,3] stands for P 0 + 4*P 1 + 3*P 2.
Syntax: numpy.polynomial.hermite.hermdiv(c1, c2)
parameters:
- c1, c2: array like objects. Hermite series coefficients are arranged from low to high in a 1-D array.
Return: quotient, remainder: ndarrays. The quotient and remainder are represented using Hermite series coefficients.
Example 1:
In this example, we created two arrays of numbers that represent coefficients using the np.array() method. coefficients should go from low to high The shape of the array is defined by the .shape attribute and the dimension of the array is defined by .ndim, the datatype of the array is returned by .dtype attribute. The hermite.hermdiv() method is used to divide two Hermite series and the result is returned. two arrays are returned. first the quotient array then the remainder array.
Python3
# import package
import numpy as np
# Creating arrays of coefficients
array = np.array([1, 5, 7])
array2 = np.array([2, 3, 5])
print(array)
print(array2)
# shape of the array is
print("Shape of the array1 is : ",
array.shape)
print("Shape of the array2 is : ",
array2.shape)
# dimension of the array
print("The dimension of the array1 is : ",
array.ndim)
print("The dimension of the array2 is : ",
array2.ndim)
# Datatype of the array
print("Datatype of our Array is : ",
array.dtype)
print("Datatype of our Array2 is : ",
array2.dtype)
# dividing two hermite series
print("Division of two hermite series : ",
np.polynomial.hermite.hermdiv(array,
array2))
Output:
[1 5 7]
[2 3 5]
Shape of the array1 is : (3,)
Shape of the array2 is : (3,)
The dimension of the array1 is : 1
The dimension of the array2 is : 1
Datatype of our Array is : int64
Datatype of our Array2 is : int64
Division of two hermite series : (array([1.4]), array([-1.8, 0.8]))
Example 2:
In this example, we give the same arrays as coefficients, as the anticipated quotient is 1 and the remainder is 0.
Python3
# import package
import numpy as np
# Creating arrays of coefficients
array = np.array([1, 5, 7])
array2 = np.array([2, 3, 5])
print(array)
print(array2)
# shape of the array is
print("Shape of the array1 is : ",
array.shape)
print("Shape of the array2 is : ",
array2.shape)
# dimension of the array
print("The dimension of the array1 is : ",
array.ndim)
print("The dimension of the array2 is : ",
array2.ndim)
# Datatype of the array
print("Datatype of our Array is : ",
array.dtype)
print("Datatype of our Array2 is : ",
array2.dtype)
# dividing two hermite series
print("Division of two hermite series : ",
np.polynomial.hermite.hermdiv(array,
array2))
Output:
[1 2 3]
[1 2 3]
Shape of the array1 is : (3,)
Shape of the array2 is : (3,)
The dimension of the array1 is : 1
The dimension of the array2 is : 1
Datatype of our Array is : int64
Datatype of our Array2 is : int64
Division of two hermite series : (array([1.]), array([0.]))
Similar Reads
Add one Hermite series to another using NumPy in Python In this article, we will cover how to add one Hermite series to another using NumPy in Python. np.polynomial.hermite.hermadd method The numpy.polynomial.hermite.hermadd() method from the NumPy library is used to add one Hermite series to another. The sum of two Hermite series (c1 + c2) is returned.
3 min read
Multiply one Hermite series to another in Python using NumPy In this article, we are going to see how to multiply one Hermite series to another in Python Using NumPy. The NumPy polynomial.hermite.hermmul() is used to Multiply one Hermite series by another series. The product of two Hermite series c1 * c2 is returned. The arguments are sequences of coefficient
2 min read
Convert a polynomial to Hermite_e series using NumPy in Python In this article, we will cover how to convert a polynomial to Hermite_e series using NumPy in Python. hermite_e.poly2herme method We use the hermite_e.poly2herme() function present in the NumPy module of python to convert a polynomial to a Hermite series. Here we need to convert an array of polynomi
2 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