Open In App

Python | sympy.zeros() method

Last Updated : 08 Aug, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

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.

Python3 1=1
# 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 :

Python3 1=1
# 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]])

Next Article
Article Tags :
Practice Tags :

Similar Reads