Thanks for helping out on matrix stuff, Bill! Bill Baxter schrieb:
> On 7/22/06, Sven Schreiber <[EMAIL PROTECTED]> wrote: >> >> Note the array slicing works correct, but the equivalent thing with the >> matrix does not. > > Looks like it happened in rev 2698 of defmatrix.py, matrix.__getitem__ > method: > > if isscalar(index[1]): > if isscalar(index[0]): > retscal = True > elif out.shape[0] == 1: > sh = out.shape > out.shape = (sh[1], sh[0]) > ==> elif isinstance(index[1], (slice, types.EllipsisType)): > ==> if out.shape[0] == 1 and not isscalar(index[0]): > > It behaves like array if you remove the 'not' in the last line. > But maybe that breaks some other cases? > Maybe you can try making that change in your numpy/core/defmatrix.py > (around line 140) and see if anything else breaks for you. > Hm, I don't know -- if you don't mind I'd like to get a second opinion before I mess around there. It's funny though that the changeset has the title "fixing up matrix slicing" or something like that... >> >> Why is the direct access to matlib impossible? > > Maybe the thinking is that since it's a compatibily module, if you > want it you should explicity import it. Like you have to do with > oldnumeric. > If that is the reason I can't really follow the logic, but I don't really mind the status quo, either. -sven ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion