Skip to content

numpy.linalg.inv returns wrong matrix? #16517

@maygloomoff

Description

@maygloomoff

I have the matrix to be inverted XSmat
numpy.linalg.inv returns matrix numpy_output that seemed correct
I cheked the output by multiplication: numpy_output * XSmat
and got correct identity matrix! But ...

I repeated same operation in MS Excel, and got other inverced matrix, that seemed correct too ...
Multiplication on origin matrix got correct identity matrix! Inverced matrix numpy_output by multiplication on XSmat in MS Excel returns NOT correct identity matrix!

So, I have two the inverce matrix for one matrix, and both are correct (in its environment)!
Help me make a choice, please!

All data in attached file:
compare matrix.xlsx

P.S. I can imagine different algorithms for inverce matrix, but i can not write other algorithm for multiplication of matrix.
**

import numpy as np
numpy_output= np.linalg.inv(Xmat)

Numpy/Python version information:

1.18.1 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions