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