Thursday, September 4, 2025
HomeLanguagesPython | Numpy np.hermecompanion() method

Python | Numpy np.hermecompanion() method

With the help of np.hermecompanion() method, we can get the companion matrix of hermiteE series by using np.hermecompanion() method.

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

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




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


Output :

[[ 0. 1. 0. -0.24494897]
[ 1. 0. 1.41421356 -0.2857738 ]
[ 0. 1.41421356 0. 1.27017059]
[ 0. 0. 1.73205081 -0.9 ]]

Example #2 :




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


Output :

[[ 0. 1. 0. -0.08164966]
[ 1. 0. 1.41421356 -0.16329932]
[ 0. 1.41421356 0. 1.38564065]
[ 0. 0. 1.73205081 -0.8 ]]

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

Most Popular

Dominic
32264 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6628 POSTS0 COMMENTS
Nicole Veronica
11799 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11858 POSTS0 COMMENTS
Shaida Kate Naidoo
6749 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6698 POSTS0 COMMENTS
Umr Jansen
6716 POSTS0 COMMENTS