[Numpy-discussion] Release of NumPy
Charles R Harris
Wed Apr 16 10:24:52 CDT 2008
On Wed, Apr 16, 2008 at 8:06 AM, Alan G Isaac <firstname.lastname@example.org> wrote:
> On Wed, 16 Apr 2008, Anne Archibald apparently wrote:
> > My (draconian) suggestion would be to simply raise an
> > exception when a matrix is indexed with a scalar.
> This has been suggested before. But then, why?
> Again, this imposes a deviation from the behavior of
> arrays that provides no gain in functionality.
> My proposal is: deviate from array behavior only when
> it gives a clear gain in functionality.
> > They're inherently two-dimensional;
> Of course. But the question is what follows from this
> as an implication for the behavior of 1d indexing and
> iteration. The answer is: nothing!
> We get to do whatever is most useful!
> > if you want a submatrix you should provide both indices
> > (possibly including a ":").
> Yes. We exactly agree on this.
> Please persuade Stefan.
> > If you actually want a subarray, as with an array, use
> > ".A".
> Again we agree on this.
> 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:
Just to make things interesting, if one uses rows (covariant) and column
(contravariant) vectors, then there are lots of ways of looking at matrices.
A covariance matrix, for instance, is a sum of tensor products of two column
vectors, its inverse of row vectors, and a normal linear transformation is
the sum of tensor products of column and row vectors. This all makes good
mathematical sense and is like tracking units. That is, it isn't done in
most numerical software ;) And remember, covariant and contravariant are
reversed from their usual meaning due to historical accident.
Next up, tensors as a subtype of ndarrays!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion