On Tue, Apr 29, 2008 at 2:18 PM, Anne Archibald <[EMAIL PROTECTED]> wrote: > On 29/04/2008, Keith Goodman <[EMAIL PROTECTED]> wrote: > > In my use i is most commonly an array (i = M.where(y.A)[0] where y is > > a nx1 matrix), sometimes a list, and in ipython when debugging or > > first writing the code, a scalar. It would seem odd to me if x[i,:] > > returned different types of objects based on the type of i: > > > > array index > > idx = M.where(y.A)[0] where y is a nx1 matrix > > x[dx,:] --> matrix > > > > list index > > idx = [0] > > x[idx,:] --> matrix? > > > > scalar index > > idx = 0 > > x[idx,:] --> not matrix > > It is actually pretty unreasonable to hope that > > A[0] > > and > > A[[1,2,3]] > or > A[[True,False,True]] > > should return objects of the same rank.
Why it unreasonable to hope that x[0,:] and x[0, [1,2,3]] or x[0, [True,False,True]] where x is a matrix, continue to return matrices? _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion