Wednesday, July 3, 2024
HomeLanguagesPythonPython | Numpy np.lagzero() method

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 lagzero
  
# using np.lagzero() method
ans = lagzero
  
print(ans)


Output :

[0]

Example #2 :




# 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]]

Nicole Veronica Rubhabha
Nicole Veronica Rubhabha
A highly competent and organized individual DotNet developer with a track record of architecting and developing web client-server applications. Recognized as a personable, dedicated performer who demonstrates innovation, communication, and teamwork to ensure quality and timely project completion. Expertise in C#, ASP.Net, MVC, LINQ, EF 6, Web Services, SQL Server, MySql, Web development,
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments