[Numpy-discussion] matrix indexing question
Mon Mar 26 07:07:36 CDT 2007
Alan G Isaac schrieb:
> Oooops, they should match of course. ::
> >>> X
> >>> X[1,:]
> matrix([[3, 4]])
> But again the point is:
> indexing for submatrices should produce matrices.
> Normal Python indexing should access the constituent arrays.
I think this is a tricky business.
There's also the rule "indexing reduces the rank, slicing preserves it".
Numpy-matrices form an exception to this rule, always being 2d, but the
exception is consistently enforced.
Now it seems you want to have an exception from the exception, correct?
Isn't this why the .A1 method for numpy-matrices was introduced even
-sven (matrix fan)
More information about the Numpy-discussion