Singular matrix issue with Numpy

前端 未结 4 629
灰色年华
灰色年华 2021-01-01 10:39

I am trying to multiply a vector(3 by 1) by its transpose(1 by 3). I get a (3 by 3) array but I cannot get its inverse. Any idea why?

import numpy as np

c=a         


        
4条回答
  •  被撕碎了的回忆
    2021-01-01 11:10

    As it was already mentioned in previous answers, your matrix cannot be inverted, because its determinant is 0. But if you still want to get inverse matrix, you can use np.linalg.pinv, which leverages SVD to approximate initial matrix.

提交回复
热议问题