Python | Numpy np.chebdiv () method

NumPy | Python Methods and Functions

Using the np.chebdiv() method, we can get the division of two Chebyshev rows using np.chebdiv () .

Syntax: np.chebdiv (s1, s2)
Return: Return an array after division.

Example # 1:
In this example, we can see that with np.chebdiv () we can get the division of two Chebyshev rows using this method.

# NumPy import

import numpy as np

from numpy.polynomial import chebyshev as C

 

s1 ( 4 , 6 , 8 )

s2 = ( 3 , 5 , 7 )

 
# using the np.chebdiv () method

gfg = C.chebdiv (s1, s2)

 

print (gfg)

Output:

(array ([1.14285714]), array ([0.57142857, 0.28571429]))

Example # 2:

# NumPy import

import numpy as np

from numpy.polynomial import chebyshev as C

 

s1 = ( 4 , 6 , 8 , 1 , 3 , 5 )

s2 = (  3 , 5 , 7 , 2 , 4 , 6 )

# using the np.chebdiv () method

gfg = C.chebdiv (s1, s2)

 

print (gfg)

Output:

(array ([0.83333333] ), array ([1.5, 1.83333333, 2.16666667, -0.66666667, -0.33333333]))





Get Solution for free from DataCamp guru