[Numpy-discussion] matrix indexing question
Alan G Isaac
Mon Mar 26 10:53:33 CDT 2007
On Mon, 26 Mar 2007, Sebastian Haase apparently wrote:
> A "matrix" is an object that you expect a certain
> (mathematical !) behavior from. If some object behaves
> intuitively right -- that's ultimately pythonic!
The problem is, as I am not the only one to point out,
this particular behavior is NOT intuitively right.
> The clash is, NOT to see a matrix "just as another
But be serious, no object is "just another container".
Again, this just begs the question.
The question is a design question.
E.g., what is the principle of least surprise?
> more notes/points:
> a) I have never heard about the m.A1 - what is it ?
It returns a 1d array holding the raveled matrix.
> b) I don't think that if m would return a (rank 2)
> matrix, that m.A could return a (rank 1) array ...
It does not, of course.
(But both should, I believe.)
> c) I'm curious if there is a unique way to extend the
> matrix class into 3D or ND.
Is that not what an array is for??
More information about the Numpy-discussion