python matrix determinant without numpy

Solutions on MaxInterview for python matrix determinant without numpy by the best coders in the world

showing results for - "python matrix determinant without numpy"
Niclas
04 Jun 2018
17
2
34
455
55
65
75
85
95
1055
115
12
Romeo
02 Feb 2019
1def det(matrix):
2    order=len(matrix)
3    posdet=0
4    for i in range(order):
5        posdet+=reduce((lambda x, y: x * y), [matrix[(i+j)%order][j] for j in range(order)])
6    negdet=0
7    for i in range(order):
8        negdet+=reduce((lambda x, y: x * y), [matrix[(order-i-j)%order][j] for j in range(order)])
9    return posdet-negdet
10