HomeLanguagesPython | Numpy np.hermcompanion() method

Python | Numpy np.hermcompanion() method

With the help of np.hermcompanion() method, we can get the companion matrix from hermite series by using np.hermcompanion() method.

Syntax : np.hermcompanion(series)
Return : Return the companion matrix.

Example #1 :
In this example we can see that by using np.hermcompanion() method, we are able to get the companion matrix from hermite series by using this method.




# import numpy and hermcompanion
import numpy as np
from numpy.polynomial.hermite import hermcompanion
  
series = np.array([6, 7, 8, 9, 10])
# using np.hermcompanion() method
gfg = hermcompanion(series)
  
print(gfg)


Output :

[[ 0. 0.70710678 0. -0.04330127]
[ 0.70710678 0. 1. -0.07144345]
[ 0. 1. 0. 1.06144556]
[ 0. 0. 1.22474487 -0.45 ]]

Example #2 :




# import numpy and hermcompanion
import numpy as np
from numpy.polynomial.hermite import hermcompanion
  
series = np.array([1, 2, 3, 4, 5])
# using np.hermcompanion() method
gfg = hermcompanion(series)
  
print(gfg)


Output :

[[ 0. 0.70710678 0. -0.01443376]
[ 0.70710678 0. 1. -0.04082483]
[ 0. 1. 0. 1.10227038]
[ 0. 0. 1.22474487 -0.4 ]]

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32686 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
7052 POSTS0 COMMENTS
Nicole Veronica
12191 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12291 POSTS0 COMMENTS
Shaida Kate Naidoo
7178 POSTS0 COMMENTS
Ted Musemwa
7444 POSTS0 COMMENTS
Thapelo Manthata
7156 POSTS0 COMMENTS
Umr Jansen
7147 POSTS0 COMMENTS