Python | Numpy np.poly2lag() method

With the help of np.poly2lag() method, we can get the laggure series coefficient from a given polynomial.

Syntax : np.poly2lag(polynomial)
Return : Return the coefficient of laguerre series.

Example #1 :
In this example we can see that by using np.poly2lag() method, we are able to get the coefficients of laguerre series from polynomial using this method.

filter_none

edit
close

play_arrow

link
brightness_4
code

# import numpy and poly2lag
import numpy as np
from numpy.polynomial.laguerre import poly2lag
  
arr = np.array([0.1, 0.2, 0.3, 0.4, 0.5])
# using np.poly2lag() method
ans = poly2lag(arr)
  
print(ans)

chevron_right


Output :

[ 15.3 -56.6 79.8 -50.4 12. ]



Example #2 :

filter_none

edit
close

play_arrow

link
brightness_4
code

# import numpy and poly2lag
import numpy as np
from numpy.polynomial.laguerre import poly2lag
  
arr = np.array([-0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4, 0.5])
# using np.poly2lag() method
ans = poly2lag(arr)
  
print(ans)

chevron_right


Output :

[ 1.97272290e+06 -1.95546092e+07 8.72343894e+07 -2.30634853e+08
4.00196230e+08 -4.76216928e+08 3.93562584e+08 -2.23051248e+08
8.29664640e+07 -1.82891520e+07 1.81440000e+06]

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.