Python | Numpy np.chebsub () method

Using the np.chebsub() method, we can get the subtraction of two Chebyshev series using np.chebsub () .

Syntax: np.chebsub (s1, s2)
Return: Return an array after subtraction.

Example # 1:
In this example, we can see that using np.chebsub () , we can get the subtraction 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.chebsub () method

gfg = C.chebsub (s1, s2 )

 

print (gfg)

Output:

[1., 1., 1.]

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.chebsub () method

gfg = C.chebsub (s1, s2)

 

print (gfg)

Output:

[1. 1. 1. -1. -one. -1.]