The NumPy module also comes with a number of built-in routines for linear algebra calculations. These can be found in the sub-module linalg.  

linalg.det

The linalg.det tool computes the determinant of an array.  

print numpy.linalg.det([[1 , 2], [2, 1]])       #Output : -3.0

linalg.eig

The linalg.eig computes the eigenvalues and right eigenvectors of a square array.    

vals, vecs = numpy.linalg.eig([[1 , 2], [2, 1]])
print vals                                      #Output : [ 3. -1.]
print vecs                                      #Output : [[ 0.70710678 -0.70710678]
                                                #          [ 0.70710678  0.70710678]]

linalg.inv  

The linalg.inv tool computes the (multiplicative) inverse of a matrix.

print numpy.linalg.inv([[1 , 2], [2, 1]])       #Output : [[-0.33333333  0.66666667]
                                                #          [ 0.66666667 -0.33333333]]

Other routines can be found here

Task

You are given a square matrix $\mbox{A}$ with dimensions $N$X$N$. Your task is to find the determinant. Note: Round the answer to 2 places after the decimal.

Input Format

The first line contains the integer $N$. 

The next $N$ lines contains the $N$ space separated elements of array $\mbox{A}$. 

Output Format

Print the determinant of $\mbox{A}$.

Sample Input
2
1.1 1.1
1.1 1.1

Sample Output
0.0

Source: hackerrank | Difficulty: EASY


Solutions:
import numpy
size = int(input())
arr = numpy.array([input().split() for _ in range(size)], float)
print(numpy.linalg.det(arr))


import numpy
n = int(input())
A = [0] * n
for i in range(n):
	A[i] = list(map(float, input().split()))
A = numpy.array(A, float)
print(numpy.linalg.det(A))


import numpy
print(numpy.linalg.det(numpy.array([list(map(float, input().split())) for n in range(int(input()))])))


import numpy
N = int(input().strip())
A = []
for i in range(N):
	A.append(numpy.array(list(map(float, input().split()))))
print(numpy.linalg.det(A))


import numpy as np
n = int(input().strip())
mat = np.array([input().strip().split(' ') for i in range(n)], float)
print(np.linalg.det(mat))


import numpy
N = int(input())
A_list = []
for i in range(N):
	A_list += [float(x) for x in input().strip().split()]
A = numpy.array(A_list).reshape(N, N)
print(numpy.linalg.det(A))


import numpy
print(numpy.linalg.det([list(map(float, input().split())) for _ in range(int(input()))]))


import numpy as np
n = int(input())
a = np.array([list(map(float, input().split())) for _ in range(n)])
print(np.linalg.det(a))


import numpy
print(numpy.linalg.det([[float(x) for x in input().split()] for x in range(int(input()))]))


import numpy as np

def main():
	n = int(input())
	l = np.array([np.array(input().split(), float) for _ in range(n)])
	print(np.linalg.det(l))
main()


import numpy
n = int(input())
poly = [numpy.array(input().split(' '), float) for i in range(n)]
print(numpy.linalg.det(poly))


import numpy
N = int(input())
a = numpy.array([list(map(float, input().split())) for _ in range(N)])
print(numpy.linalg.det(a))


import numpy
a = numpy.array([input().split() for _ in range(int(input()))], float)
print(numpy.linalg.det(a))


import numpy
n = int(input())
A = [[float(i) for i in input().strip().split()] for j in range(n)]
print(numpy.linalg.det(A))


import numpy as np
N = int(input())
arr1 = []
for _ in range(N):
	arr1.append([float(x) for x in input().split(' ')])
a = np.array(arr1).reshape(N, N)
print(np.linalg.det(a))


import numpy
a = []
for _ in range(int(input().strip())):
	a.append(list(map(float, input().strip().split())))
print(numpy.linalg.det(a))


import numpy as np
repeat = int(input())
array = np.array([list(map(float, input().split(' '))) for i in range(repeat)])
print(np.linalg.det(array))


import numpy
arr = []
d = int(input().split()[0])
for i in range(d):
	arr.append(list(map(float, input().split())))
print(numpy.linalg.det(numpy.array(arr)))


import numpy
n = int(input())
arr = numpy.array([input().split() for a in range(n)], float)
print(numpy.linalg.det(arr))


import numpy
i = int(input())
arr = []
while i > 0:
	i = i - 1
	arr.append([float(x) for x in input().split()])
print(numpy.linalg.det(numpy.array(arr)))


import numpy
N = int(input())
a = numpy.array([list(map(float, input().split())) for x in range(N)])
print(numpy.linalg.det(a))


import numpy as np
import sys
N = int(sys.stdin.readline())
A = np.array([sys.stdin.readline().split() for _ in range(N)], float)
print(np.linalg.det(A))


import numpy
A = []
for _ in range(int(input())):
	A.append(input().split())
A = numpy.array(A, float)
print(numpy.linalg.det(A))


import numpy
n = int(input().strip())
arr = numpy.array([list(map(float, input().strip().split())) for line in range(n)])
print(numpy.linalg.det(arr))


import numpy
print(numpy.linalg.det(numpy.array([list(map(float, input().split())) for i in range(int(input()))])))


import numpy
N = int(input())
a = []
for i in range(N):
	a.append(list(map(float, input().split())))
a = numpy.array(a)
print(numpy.linalg.det(a))


import numpy
n = int(input())
n_array = numpy.array([list(map(float, input().split())) for i in range(n)])
print(numpy.linalg.det(n_array))


import numpy
n = int(input())
myarray = numpy.array([list(map(float, input().split())) for _ in range(n)])
print(numpy.linalg.det(myarray))


import numpy
n = int(input())
a = numpy.array([[float(e) for e in input().split()] for i in range(n)])
print(numpy.linalg.det(a))


import numpy as np
N = int(input())
L1 = []
for i in range(N):
	L1.append(list(map(float, input().split())))
npArr = np.array(L1)
print(np.linalg.det(npArr))


import numpy
l = list()
for _ in range(int(input())):
	l.append(list(map(float, input().split())))
a = numpy.array(l)
print(numpy.linalg.det(a))


import numpy as np
n = int(input())
a = []
for i in range(n):
	a.append(list(map(float, input().split())))
a = np.array(a)
print(np.linalg.det(a))


import numpy
n = int(input())
A = numpy.array([input().split() for i in range(n)], float)
print(numpy.linalg.det(A))


import numpy
n = int(input())
arr = numpy.array([list(map(float, input().strip().split())) for _ in range(n)])
print(numpy.linalg.det(arr))


import numpy as np
a = np.array([list(map(float, input().split())) for i in range(int(input()))])
print(np.linalg.det(a))


import numpy
N = int(input())
A = numpy.array([input().split() for i in range(N)], float)
print(numpy.linalg.det(A))


import numpy
n = int(input())
ar = []
for i in range(n):
	tmp = list(map(float, input().split()))
	ar.append(tmp)
np_ar = numpy.array(ar, float)
print(numpy.linalg.det(np_ar))


import numpy
n = int(input().strip())
a = []
for i in range(n):
	a.append(list(map(float, input().strip().split())))
a = numpy.array(a)
print(numpy.linalg.det(a))


import numpy
N = int(input())
Array = []
for i in range(N):
	Array.append(list(map(eval, input().split(' '))))
print(numpy.linalg.det(Array))


import numpy as np
N = int(input())
NP = np.array([list(map(float, input().split())) for i in range(N)])
print(np.linalg.det(NP))


import numpy
N = int(input())
A = numpy.array([list(map(float, input().split())) for i in range(N)])
print(numpy.linalg.det(A))


import numpy
n = int(input())
a = numpy.array([list(map(float, input().strip().split())) for i in range(n)])
print(numpy.linalg.det(a))


import numpy
N = int(input())
print(numpy.linalg.det(numpy.array([list(map(float, input().split())) for _ in range(N)])))


import numpy
l = []
for i in range(int(input())):
	l.append(list(map(float, input().split())))
print(numpy.linalg.det(l))


import numpy as np
n = int(input())
l = [input().split() for i in range(n)]
a = np.array(l, float)
print(np.linalg.det(a))


import numpy
N = int(input())
A = numpy.array([input().split() for _ in range(N)], float)
print(numpy.linalg.det(A))


import numpy
N = int(input())
motoarr = []
for idx in range(0, N, 1):
	mojir = input()
	hyo = mojir.split(' ')
	yokovec = [float(mono) for mono in hyo]
	motoarr.append(yokovec)
arr = numpy.array(motoarr)
print(numpy.linalg.det(arr))


from numpy import *
N = int(input())
A = array([input().split() for _ in range(N)], float)
print(linalg.det(A))


import numpy as np
N = int(input())
A = np.array([input().split() for _ in range(N)], float)
print(np.linalg.det(A))


from numpy import array
from numpy.linalg import det
N = int(input())
A = array([[float(i) for i in input().strip().split()] for _ in range(N)])
print(det(A))


import numpy
nb = int(input())
A = numpy.array([list(map(float, input().split())) for i in range(nb)])
print(numpy.linalg.det(A))


import numpy
n = int(input())
print(numpy.linalg.det(numpy.array([input().split() for i in range(n)], float)))


import numpy
n = int(input())
mat = [[float(x) for x in input().split()] for _ in range(n)]
print(numpy.linalg.det(mat))


import numpy
n = int(input())
print(numpy.linalg.det(numpy.array([list(map(float, input().split())) for i in range(n)])))


import numpy as np
n = int(input())
x = np.fromstring(' '.join([input() for _ in range(n)]), sep=' ', dtype=float).reshape(n, n)
print(np.linalg.det(x))


import numpy
a = numpy.array(input(), int)
b = [numpy.array(input().split(), float) for i in range(a)]
print(numpy.linalg.det(b))


import numpy
print(numpy.linalg.det([[float(x) for x in input().split()] for _ in range(int(input()))]))


import numpy
n = int(input())
print(numpy.linalg.det(numpy.array([list(map(float, input().split())) for allvals in range(0, n)])))


import numpy
n = int(input())
arr1 = []
for _ in range(n):
	arr1.append([float(e) for e in input().split()])
arr = numpy.array(arr1, dtype=float)
print(numpy.linalg.det(arr))


import numpy
print(numpy.linalg.det(numpy.array([input().split() for i in range(int(input()))], float)))


import numpy as np
n = int(input())
a = np.array([[float(i) for i in input().split()] for j in range(n)])
print(np.linalg.det(a))


import sys
import numpy as np

def main():
	f = open(sys.argv[1], 'r') if len(sys.argv) > 1 else sys.stdin
	N = int(f.readline())
	A = []
	for _ in range(N):
		A.append([float(i) for i in f.readline().split()])
	print(np.linalg.det(A))
main()


import numpy, sys
n = int(input().strip())
mat = []
for i in range(n):
	row = input().strip().split(' ')
	row = list(map(float, row))
	mat.append(row)
print(numpy.linalg.det(mat))


import numpy
a = numpy.array(tuple((input().split() for _ in range(int(input())))), float)
print(numpy.linalg.det(a))


import numpy
N = int(input())
iArr = numpy.array([list(map(float, input().split())) for i in range(N)])
print(numpy.linalg.det(iArr))


import numpy
n = int(input())
array_a = []
for _ in range(n):
	array_a.append([float(x) for x in input().split()])
print(numpy.linalg.det(array_a))


import numpy
N = int(input())
A = numpy.array([list(map(float, input().strip().split())) for x in range(N)], float)
print(numpy.linalg.det(A))


import numpy
m = int(input())
my_array = []
for i in range(m):
	my_array.append(list(map(float, input().split())))
my_array = numpy.array(my_array)
print(numpy.linalg.det(my_array))


import numpy as np
N = int(input())
A = np.array([list(map(float, input().split())) for _ in range(N)])
print(np.linalg.det(A))


import operator
import numpy

def read_f(f):
	return f(input())

def read_f_words(f):
	return mapl(f, input().split())

def mapl(f, x):
	return list(map(f, list(x)))

def read_a(f, n):
	ns = []
	for x in range(n):
		ns.append(read_f_words(f))
	return numpy.array(ns, f)
n = read_f(int)
a = read_a(float, n)
print(numpy.linalg.det(a))


import numpy
N = int(input())
A = numpy.array([list(map(float, input().split())) for _ in range(N)])
print(numpy.linalg.det(A))


import numpy
array = [list(map(float, input().split())) for i in range(int(input()))]
print(numpy.linalg.det(array))


import numpy
print(numpy.linalg.det(numpy.array([input().split() for _ in range(int(input()))], float)))


import numpy as np
N = int(input())
arr = np.empty((N, N))
for i in range(N):
	arr[i] = np.array(input().split(), dtype=float)
print(np.linalg.det(arr))


import numpy as np
num = int(input())
arr = np.array([input().split() for _ in range(num)], dtype=float)
print(np.linalg.det(arr))


import numpy
m = int(input())
a = numpy.array([input().split(' ') for _ in range(m)], float)
print(numpy.linalg.det(a))


import numpy as np
a = np.array([list(map(float, input().split())) for _ in range(int(input()))])
print(np.linalg.det(a))


import numpy
n = int(input())
a = []
for i in range(n):
	a.append(list(map(float, input().split())))
print(numpy.linalg.det(a))


import numpy as np
N = int(input())
data = np.array([list(map(lambda x: float(x), input().split())) for _ in range(N)])
print(np.linalg.det(data))


import numpy
n = int(input())
a = numpy.array([input().split() for _ in range(n)], float)
print(numpy.linalg.det(a))


import numpy
N = int(input())
ll = []
for n in range(N):
	ll += [float(x) for x in input().split()]
a = numpy.array(ll).reshape(N, N)
print(numpy.linalg.det(a))


import sys
import numpy as np
n = int(input())
my_list = []
for _ in range(n):
	my_list.append([float(x) for x in input().split()])
my_array = np.array(my_list, dtype=float)
print(np.linalg.det(my_array))


import numpy
print(numpy.linalg.det(numpy.array([[i for i in map(float, input().split())] for j in range(int(input()))])))


import numpy
n = int(input())
array = [list(map(float, input().split())) for i in range(n)]
print(numpy.linalg.det(array))


import numpy
n = int(input())
a = []
for i in range(n):
	a.extend(list(map(float, input().split())))
a = numpy.array(a)
a.shape = (n, n)
print(numpy.linalg.det(a))


from numpy import linalg
N = int(input())
L = [[float(x) for x in input().split()] for i in range(N)]
print(linalg.det(L))


import numpy
n = int(input())
a = numpy.array([input().split() for i in range(n)], float)
print(numpy.linalg.det(a))


import numpy
print(numpy.linalg.det(numpy.array([[float(x) for x in input().strip().split()] for _ in range(int(input().strip()))])))


import numpy as np
n = int(input().strip())
array = np.array([[float(x) for x in input().strip().split()] for _ in range(n)], dtype=float)
print(np.linalg.det(array))