Python | Numpy np.lagzero() method (original) (raw)

Last Updated : 29 Dec, 2019

**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 :

Python3 1=1 `

Python program explaining

numpy.lagzero() method

import numpy and lagzero

import numpy as np from numpy.polynomial.laguerre import lagzero

using np.lagzero() method

ans = lagzero

print(ans)

`

Output :

[0]

Example #2 :

Python3 1=1 `

Python program explaining

numpy.lagzero() method

import numpy and lagzero

import numpy as np from numpy.polynomial.laguerre import lagzero

using np.lagzero() method

ans = lagzero + [[1, 3, 5], [2, 4, 6]]

print(ans)

`

Output :

[[1 3 5] [2 4 6]]