1

Question could be DUPLICATE.

I'am trying to solve systems of linear equations using NumPy, and i face situations, when system is non-square. It can have infinite solutions, or no solutions. What is the way to handle these kind of situations to show no solution or infinite solutions outcome?

I've seen here the way, by using

np.linalg.lstsq(a, b, rcond=None)[0]

This method uses Least Square method, that is not helpful in my condition.

Adil Shirinov
  • 135
  • 1
  • 9
  • it usually depends on what for the solution is used... – Spektre Dec 12 '18 at 08:58
  • 1
    Have you seen [this post](https://stackoverflow.com/questions/46377331/solving-ax-b-for-a-non-square-matrix-a-using-python) ? – Tarifazo Dec 12 '18 at 12:51
  • 1
    If you have more equations than unknowns, you use least squares regression. If you have more unknowns than equations, you use singular value decomposition. – duffymo Dec 12 '18 at 16:04

0 Answers0