Sunday, January 19, 2025
Google search engine
HomeLanguagesPython | sympy.det() method

Python | sympy.det() method

With the help of sympy.det() method, we can find the determinant of a matrix by using sympy.det() method.

Syntax : sympy.det()
Return : Return determinant of a matrix.

Example #1 :
In this example, we can see that by using sympy.det() method, we are able to find the determinant of a matrix.




# import sympy
from sympy import *
  
# Use sympy.det() method
mat = Matrix([[1, 0, 1], [2, -1, 3], [4, 3, 2]])
d = mat.det()
   
print(d)


Output :

-1

Example #2 :




# import sympy
from sympy import *
  
# Use sympy.det() method
mat = Matrix([[1, 5, 1], [12, -1, 31], [4, 33, 2]])
d = mat.det()
   
print(d)


Output :

-125

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

Most Popular

Recent Comments