Monday, November 18, 2024
Google search engine
HomeLanguagesPython | Numpy np.polyzero() method

Python | Numpy np.polyzero() method

np.polyzero() method can be used instead of np.zeros for creating a array whose elements are 0.

Syntax : np.polyzero()
Return : Return array([0])

Example #1 :




    
# Python program explaining
# numpy.polyzero() method 
  
# import numpy and polyzero
import numpy as np
from numpy.polynomial.polynomial import polyzero
  
# using np.polyzero() method
ans = polyzero
  
print(ans)


Output :

[0]

Example #2 :




# Python program explaining
# numpy.polyzero() method 
  
# import numpy and polyzero
import numpy as np
from numpy.polynomial.polynomial  import polyzero
  
# using np.polyzero() method
ans = polyzero + [[1, 3, 5], [2, 4, 6]]
  
print(ans)


Output :

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

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments