# Python | Numpy np.hermfromroots() method

With the help of `np.hermfromroots()` method, we can get the hermite series coefficient from given roots by using `np.hermfromroots()` method.

Syntax : `np.hermfromroots(roots)`
Return : Return the coefficient of hermite series.

Example #1 :
In this example we can see that by using `np.hermfromroots()` method, we are able to get the coefficient of hermite series from given roots by using this method.

 `# import numpy and hermfromroot ` `import` `numpy as np ` `from` `numpy.polynomial.hermite ``import` `hermfromroots ` ` `  `roots ``=` `np.array([``0.1``, ``2``, ``0.3``, ``4``]) ` `# using np.hermfromroots() method ` `gfg ``=` `hermfromroots(roots) ` ` `  `print``(gfg) `

Output :

[6.205 -6.49 3.3575 -0.8 0.0625]

Example #2 :

 `# import numpy and hermfromroot ` `import` `numpy as np ` `from` `numpy.polynomial.hermite ``import` `hermfromroots ` ` `  `roots ``=` `np.array([``1``, ``2``, ``3``, ``4``, ``1.0001``]) ` `# using np.hermfromroots() method ` `gfg ``=` `hermfromroots(roots) ` ` `  `print``(gfg) `

Output :

[-7.4754225e+01 7.2628250e+01 -2.9500950e+01 6.2501250e+00
-6.8750625e-01 3.1250000e-02]

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.