From: jj <jos...@ya...> - 2006-10-10 13:20:11
|
> > -- If M is a nxm matrix and P and Z are nx1 (or 1xn) > > matrices, then it would be nice if we could write > > M[P==Z,:] to obtain all columns and only those rows > > where P==Z. > This works already if p and z are 1-d arrays. That seems to be the > only issue. you want this to work with p and z being 2-d arrays (i.e. > matrices). The problem is there is already a defined behavior for this > case that would have to be ignored (i.e. special-cased to get what you > want). This could be done within the special matrix sub-class of > course, but I'm not sure it is wise. Too many special cases make life > difficult down the road. > Thanks for the thoughtful reply Travis. I see I will just have to get used to using code such as M[(P==Z).A.ravel(),:], which I can live with. Your comments helped put this in perspective for me. By the way, is there a web site that lists all the current modules (as does http://www.scipy.org/doc/api_docs/scipy.html)? Best, John |