June 2015
Beginner
348 pages
8h 44m
English
To calculate the determinant of a matrix, follow these steps:
A = np.mat("3 4;5 6")
print("A\n", A)The matrix we created appears as follows:
A [[ 3. 4.] [ 5. 6.]]
det() function:print("Determinant", np.linalg.det(A))The determinant appears as follows:
Determinant -2.0
We calculated the determinant of a matrix with the det() function from the numpy.linalg module (see determinant.py):
from __future__ import print_function
import numpy as np
A = np.mat("3 4;5 6")
print("A\n", A)
print("Determinant", np.linalg.det(A))Read now
Unlock full access