Use numpy.linalg.solve instead of numpy.linalg.lstsq to solve square matrix linear system