[Numpy-discussion] untenable matrix behavior in SVN
Tue Apr 29 16:42:24 CDT 2008
On Tue, Apr 29, 2008 at 11:16:15PM +0200, Anne Archibald wrote:
> On 29/04/2008, Gael Varoquaux <email@example.com> wrote:
> > On Tue, Apr 29, 2008 at 11:03:58PM +0200, Anne Archibald wrote:
> > > I am puzzled by this. What is the rationale for x[i,:] not being a 1-d
> > > object?
> > It breaks A*B[i, :] where A and B are matrices.
> Really? How?
> In : A = np.matrix([[1,0],[0,1],[1,1]])
> In : A*np.ones(2)
> Out: matrix([[ 1., 1., 2.]])
> In : np.ones(3)*A
> Out: matrix([[ 2., 2.]])
Yes, sorry, I am shameful. I should have thought a bit more before
There is no big problem with x[i,:] not being a 1-d object. The problem
is for x[:, i]. However I would find it nice that, for linear algebra,
x[i, :] == x[:, i].T
This is the kind of behavior I expect, and we won't be getting it with 1D
More information about the Numpy-discussion