How to Calculate Determinant of a Matrix or ndArray?

How to Calculate Determinant of a Matrix or ndArray?

This recipe helps you Calculate Determinant of a Matrix or ndArray
In [1]:
## How to Calculate Determinant of a Matrix or ndArray
def Kickstarter_Example_9():
    print()
    print(format('How to Calculate Determinant of a Matrix or ndArray'
                 , '*^72'))
    # Load library
    import numpy as np
    # Create matrix
    matrixA = np.array([[1, 2, 3, 23],
                       [4, 5, 6, 25],
                       [7, 8, 9, 28],
                       [10, 11, 12, 41]])

    matrixB = np.array([[2, 3, 4],
                       [5, 6, 9],
                       [7, 8, 1]])
    # Return determinant of matrix
    print(); print(np.linalg.det(matrixA))
    print(); print(np.linalg.det(matrixB))
Kickstarter_Example_9()
**********How to Calculate Determinant of a Matrix or ndArray***********

-4.862776847858206e-15

33.99999999999999


Stuck at work?
Can't find the recipe you are looking for. Let us know and we will find an expert to create the recipe for you. Click here
Companies using this Recipe
1 developer from KPMG
1 developer from YASH Technologies
1 developer from Altimetrik
1 developer from LTI
1 developer from ANAC
1 developer from MudraCircle
1 developer from HvH
1 developer from Vodafone