[SciPy-user] solving linear equations ?

Stef Mientki s.mientki@ru...
Wed Nov 5 13:46:59 CST 2008


(forgive my math is a bit rusty, so I don't know the right terms anymore)

If I want to solve a set of linear equations,
I use in MatLab:

  a \ b

this works also if I have too many equations, so more columns than rows.
In Numpy for Matlab users


I read this:
  linalg.solve(a,b) if a is square
     linalg.lstsq(a,b) otherwise

I find the name already suspicious, sound like least square,
which is confirmed by the help.

So I guess the translation from MatLab to Numpy is not correct.

Is there a function to reduce the number of columns / remove the 
redundancy, so I end up with a square matrix ?

Stef Mientki

More information about the SciPy-user mailing list