determinante
import numpy as np
a=np.array([[1,2],[3,4]])
print (np.linalg.det(a))
#computing determinants for stack of matrices:
a=np.array([[[1,2],[3,4]],[[1,2],[2,1]],[[1,3],[3,1]]])
print (a.shape)
print (np.linalg.det(a))
print (a)
b=np.array([[3,2,1],[0,2,-5],[-2,1,4]])
print (b.shape)
print (b)
print (np.linalg.det(b))
a=np.array([[1,2],[3,4]])
print (np.linalg.det(a))
#computing determinants for stack of matrices:
a=np.array([[[1,2],[3,4]],[[1,2],[2,1]],[[1,3],[3,1]]])
print (a.shape)
print (np.linalg.det(a))
print (a)
b=np.array([[3,2,1],[0,2,-5],[-2,1,4]])
print (b.shape)
print (b)
print (np.linalg.det(b))
Comentarios
Publicar un comentario