[Numpy-discussion] matrix default to column vector?

Christopher Barker Chris.Barker@noaa....
Mon Jun 8 11:55:09 CDT 2009

```Olivier Verdier wrote:
>  One
> should realize that allowing dot(A,B,C) is just *better* than the
> present situation where the user is forced into writing dot(dot(A,B),C)
> or dot(A,dot(B,C)).

I'm lost now -- how is this better in any significant way?

Tom K. wrote:
> But,
> almost all experienced users drift away from matrix toward array as they
> find the matrix class too limiting or strange

That's one reason, and the other is that when you are doing real work,
it is very rare for the linear algebra portion to be significant. I know
in my code (and this was true when I was using MATLAB too), I may have
100 lines of code, and one of them is a linear algebra expression that
could be expressed nicely with matrices and infix operators. Given that
the rest of the code is more natural with nd-arrays, why the heck would
I want to use matrices? this drove me crazy with MATLAB -- I hated the
default matrix operators, I was always typing ".*", etc.

> - it seems only applicable for new users and pedagogical purposes.

and I'd take the new users of this list -- it serves no one to teach
people something first, then tell them to abandon it. Which leaves the
pedagogical purposes. In that case, you really need operators, slightly
cleaner syntax that isn't infix really doesn't solve the pedagogical
function.

It seems there is a small but significant group of folks on this list
that want matrices for that reason. That group needs to settle on a
solution, and then implement it. Personally, I think the row-vector,
column-vector approach is the way to go -- even though, yes, these are
matrices that happen to have one dimension or the other set to one, I
know that when I was learning LA (and still), I thought about row and
column vectors a fair bit, and indexing them in a simple way would be
nice.  But I don't teach, so I'll stop there.

-Chris

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov
```