Lingerror last 2 dimensions of the array must be square

Lingerror last 2 dimensions of the array must be square

reason

Because numpy uses X directly= numpy.linalg.solve (a, b) we must make sure that a is a square matrix, but my matrix is not a square matrix

solve

The least square method: C= np.linalg.lstsq (A, B, rcond=None)[0]

problem

It seems to be an equation with infinite solutions, and I don’t know how to output a unique solution in a specific range

Read More: