Python Inverse of a Matrix

后端 未结 7 1118
遥遥无期
遥遥无期 2020-12-04 06:48

How do I get the inverse of a matrix in python? I\'ve implemented it myself, but it\'s pure python, and I suspect there are faster modules out there to do it.

7条回答
  •  长情又很酷
    2020-12-04 07:28

    Numpy will be suitable for most people, but you can also do matrices in Sympy

    Try running these commands at http://live.sympy.org/

    M = Matrix([[1, 3], [-2, 3]])
    M
    M**-1
    

    For fun, try M**(1/2)

提交回复
热议问题