[Numpy-discussion] numpy release
Alan G Isaac
Fri Apr 25 11:04:27 CDT 2008
I think the use of the term 'vector' in this
thread is becoming a bit confusing.
An M by N matrix is a vector. (I.e., it is
an element of a vector space.)
Many people use the terms "row vector" and "column
vector" to refer to special matrices. What is
special is *not* that they are vectors (since
all matrices are) but that they are a single
row or a single column. Perhaps better
terminology would have been "row matrix" and
"column matrix". Using this terminology, we
clearly expect a row matrix and a column matrix
to have transposes. The question is, can their
elements be indexed by scalars. The answer in
all the proposals, I believe, is "yes".
I believe we are finding that this answer has
x is a 2 by 2 matrix
x is a 1 by 2 matrix
x is x[0,0] GOOD!!
y = x -> y is a 1 by 2 matrix
y is a TypeError BAD!!
So I am becoming more and more persuaded that
for a matrix ``x``:
x should be a 1d array (always!)
x[0,:] should be a matrix
use non-scalar indexing to extract submatrices
More information about the Numpy-discussion