Python | Numpy np.legzero() method (original) (raw)
Last Updated : 31 Dec, 2019
**np.legzero()**
method can be used instead of np.zeros for creating a array whose elements are 0.
Syntax :
np.legzero()
Return : Return array([0])
Example #1 :
import
numpy as np
from
numpy.polynomial.legendre
import
legzero
ans
=
legzero
print
(ans)
Output :
[0]
Example #2 :
import
numpy as np
from
numpy.polynomial.legendre
import
legzero
ans
=
legzero
+
[[
1
,
3
,
5
], [
2
,
4
,
6
]]
print
(ans)
Output :
[[1 3 5]
[2 4 6]]
Similar Reads
- Python | Numpy np.lagzero() method np.lagzero() method can be used instead of np.zeros for creating a array whose elements are 0. Syntax : np.lagzero() Return : Return array([0]) Example #1 : # Python program explaining # numpy.lagzero() method # import numpy and lagzero import numpy as np from numpy.polynomial.laguerre import lagzer 1 min read
- Python | Numpy np.legroots() method np.legroots() method is used to compute the roots of a legendre series.Return the roots of the polynomial. Syntax : np.legroots(c) Parameters: c :[array_like] 1-D arrays of legendre series coefficients. Return : [ndarray] Array of the roots of the series. If all the roots are real, then out is also 1 min read
- Python | Numpy np.hermzero() method With the help of np.hermzero() method, we can use hermzero instead of np.zeros by using np.hermzero() method. Syntax : np.hermzero() Return : Return array([0]) Example #1 : In this example we can see that by using np.hermzero() method, we are able to get the functionality of np.zeros as same as this 1 min read
- Python | Numpy np.hermezero() method With the help of np.hermezero() method, we can use hermezero instead of np.zeros() by using np.hermezero() method. Syntax : np.hermezero Return : Return the array of zeros. Example #1 : In this example we can see that by using np.hermezero() method, we are able to get the functionality of np.zeros a 1 min read
- Python | Numpy np.legvander() method np.legvander() method is used to returns the Vandermonde matrix of degree deg and sample points x. Syntax : np.legvander(x, deg) Parameters: x :[ array_like ] Array of points. The dtype is converted to float64 or complex128 depending on whether any of the elements are complex. If x is scalar it is c 1 min read
- Python | Numpy np.leg2poly() method np.leg2poly() method is used to convert a legendre series to a polynomial. Syntax : np.leg2poly(c) Parameters: c :[array_like] 1-D arrays of legendre series coefficients ordered from low to high. Return : [ndarray] 1-D array containing the coefficients of the equivalent polynomial. Code #1 : # Pytho 1 min read
- Python | Numpy np.lagroots() method np.lagroots() method is used to compute the roots of a Laguerre series.Return the roots of the polynomial. Syntax : np.lagroots(c) Parameters: c :[array_like] 1-D arrays of Laguerre series coefficients ordered from low to high. Return : [ndarray] Array of the roots of the series. If all the roots ar 1 min read
- Python | Numpy np.legdiv() method np.legdiv() method is used to divide one Legendre series to another.It returns the quotient-with-remainder of two Legendre series c1 / c2. Syntax : np.legdiv(c1, c2) Parameters: c1, c2 :[ array_like ] 1-D arrays of Legendre series coefficients ordered from low to high. Return : [ndarray] Legendre se 1 min read
- Python | Numpy np.legmul() method np.legmul() method is used to multiply one Legendre series to another.It returns the product of two Legendre series c1 * c2. Syntax : np.legmul(c1, c2) Parameters: c1, c2 :[ array_like ] 1-D arrays of Legendre series coefficients ordered from low to high. Return : [ndarray] Legendre series coefficie 1 min read
- Python | Numpy np.legadd() method np.legadd() method is used to add one Legendre series to another.It returns the sum of two Legendre series c1 + c2. Syntax : np.legadd(c1, c2) Parameters: c1, c2 :[ array_like ] 1-D arrays of Legendre series coefficients ordered from low to high. Return : [ndarray] Array representing the Legendre se 1 min read