[Numpy-discussion] untenable matrix behavior in SVN
Tue Apr 29 16:18:23 CDT 2008
On 29/04/2008, Keith Goodman <email@example.com> wrote:
> On Tue, Apr 29, 2008 at 11:21 AM, Alan G Isaac <firstname.lastname@example.org> wrote:
> > On Tue, 29 Apr 2008, Keith Goodman apparently wrote:
> > > I often use x[i,:] and x[:,i] where x is a matrix and i is
> > > a scalar. I hope this continues to return a matrix.
> > 1. Could you give an example of the circumstances of this
> > use?
> In my use i is most commonly an array (i = M.where(y.A) 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) where y is a nx1 matrix
> x[dx,:] --> matrix
> list index
> idx = 
> x[idx,:] --> matrix?
> scalar index
> idx = 0
> x[idx,:] --> not matrix
It is actually pretty unreasonable to hope that
should return objects of the same rank.
More information about the Numpy-discussion