strange array size problem

Oscar Benjamin oscar.j.benjamin at gmail.com
Fri Oct 18 12:05:05 EDT 2013


On 18 October 2013 16:52,  <chip9munk at gmail.com> wrote:
> Interesting!
> rank of the whole minus last row
> numpy.linalg.matrix_rank(users_elements_matrix[:,0:42]) is 42
>
> but also rank of whole is
> numpy.linalg.matrix_rank(users_elements_matrix[:,0:43]) is 42
>
> but what does that mean?!

It means that the additional column is a linear combination of the
existing columns. This means that your system of equations can contain
a contradiction. Essentially you're trying to get the least squares
solution to something like:

3*x + y = 1
1*x + 2*y = 4
1*x + 2*y = 5  # Contradicts the equation above

Because of floating point error it isn't *exactly* a contradiction so
you get silly values instead of an error.

> could you explain briefly what now?

http://en.wikipedia.org/wiki/Rank_(linear_algebra)


Oscar



More information about the Python-list mailing list