From: Keith G. <kwg...@gm...> - 2006-10-24 00:26:58
|
On 10/23/06, Travis Oliphant <oli...@ie...> wrote: > Keith Goodman wrote: > > On 10/20/06, JJ <jos...@ya...> wrote: > > > >> My suggestion is to > >> create a new attribute, such as .AR, so that the > >> following could be used: M[K.AR,:] > >> > > > > It would be even better if M[K,:] worked. Would such a patch be > > accepted? (Not that I know how to make it.) > > > What exactly do you want to work? x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11], [12, 13, 14, 15]]) idx matrix([[1], [3]]) I'd like (if it doesn't break the consistency of numpy): -------------------------------------- x[idx, :] to give matrix([[ 4, 5, 6 , 7], 12, 13, 14 ,15]]) instead of matrix([[[ 4, 5, 6, 7]], [[12, 13, 14, 15]]]) -------------------------------------- x[:, idx] top give a 4x2 matrix instead of an error -------------------------------------- x[x[:,0] > 4, :] to give a 2x4 matrix instead of a 1x2 matrix -------------------------------------- I'd also like a pony. |