Open In App
Related Articles

Python | sympy.zeros() method

Improve Article
Improve
Save Article
Save
Like Article
Like

With the help of sympy.zeros() method, we can create a matrix having dimension nxm and filled with zeros by using sympy.zeros() method.

Syntax : sympy.zeros()
Return : Return a zero matrix.

Example #1 :
In this example, we can see that by using sympy.zero() method, we are able to create the zero matrix having dimension nxn all filled with zeros, where nxm will be pass as a parameter.




# import sympy
from sympy import *
  
# Use sympy.zero() method
mat = zeros(3, 4)
   
print(mat)


Output :

Matrix([
[0, 0, 0, 0],
[0, 0, 0, 0],
[0, 0, 0, 0]])

Example #2 :




# import sympy
from sympy import *
  
# Use sympy.zero() method
mat = zeros(2, 4)
   
print(mat)


Output :

Matrix([[0, 0, 0, 0],
[0, 0, 0, 0]])

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 29 Jun, 2019
Like Article
Save Article
Similar Reads
Related Tutorials