[Numpy-discussion] untenable matrix behavior in SVN
Tue Apr 29 13:46:41 CDT 2008
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
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:
idx = M.where(y.A) where y is a nx1 matrix
x[dx,:] --> matrix
idx = 
x[idx,:] --> matrix?
idx = 0
x[idx,:] --> not matrix
> 2. Would any or all of the following be just as good
> a result?
> a. 1d matrix
> b. row and column vectors (1d but "oriented" for
> linear algebra purposes)
For me, having arrays and matrices is confusing enough. Adding row and
column objects sounds even more confusing.
> 3. If 2a. and 2b. are no good for you,
> a. would e.g. ``x[i:i+1,:]`` be too burdensome?
> b. would ``rows`` and ``columns`` attributes that
> yielded matrics be an offsetting convenience?
I like the idea, from earlier in the thread, of row and col being
iterators for those time when you want to work on one column or row at
More information about the Numpy-discussion