[Numpy-discussion] Release of NumPy
Charles R Harris
Wed Apr 16 12:41:56 CDT 2008
On Wed, Apr 16, 2008 at 11:01 AM, Gael Varoquaux <
> On Wed, Apr 16, 2008 at 10:06:05AM -0400, Alan G Isaac wrote:
> > > if you want a submatrix you should provide both indices
> > > (possibly including a ":").
> > Yes. We exactly agree on this.
> > Please persuade Stefan.
> Alan, instead of trying blindly to persuade Stefan, please listen to his
> arguments. Or code an example implementation and show it to us. Stefan,
> and incidently myself, believe your position cannot be described in a
> consistent way, and that the day you try to code it, it will fall down.
> This is why the RowVector and ColumnVector idea was proposed. For me it
> is the only consistent proposal I have heard so far. I don't care that
> much about all this, but I do care that you are trying to get developpers
> lose their time on something that cannot work.
> > But none of this answers the question:
> > what should you get when you iterate over a matrix.
> > Stefan seems to agree with me to this extent:
> > we should get its "rows". This disagreement is
> > over what that means:
> > are these submatrices, a new vector object, or 1d arrays?
> > I claim that if you use matrices, you will find it
> > natural for these to be 1d arrays.
> OK, let us pretend A[:, 1] returns a 1D array, as you seem to be wanting,
> (A and B are matrices),
> What is A[1, :] * B then? You are multiply an array with a matrix. That
> already is dodgy, but numpy deals with it, and you get what you want.
> What about B*A[:, 1]? You don't get what you want here. So you have
> broken the user's expectation once again.
> The question is should we break this expectation (1), the expectation that
> A[x][y] = A[x, y] (2), or add RowVector and ColumnVector (3)?
Dirac called them bra and ket vectors; put them together and you get bracket
(inner product). Those might be alternative, shorter names.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion