[Numpy-discussion] matrix wart
Konrad Hinsen
konrad.hinsen@laposte....
Fri Feb 22 09:14:48 CST 2008
On Feb 22, 2008, at 15:55, Travis E. Oliphant wrote:
>> ColumnVector, and RowVector. It would work like this:
>>
>> m = Matrix([[1, 2], [3, 4]])
>>
>> m[0, :] --> ColumnVector([1, 3])
>> m[:, 0] --> RowVector([1, 2])
>>
> These seem backward to me. I would think that m[0,:] would be the
> RowVector([1,2]) and m[:,0] be the ColumnVector([1,3]).
Right.
> What is m[0] in this case? The same as m[0, :]?
Yes.
>> However, the matrix implementation in Numeric was inspired by Matlab,
>> where everything is a matrix. But as I said before, Python is not
>> Matlab.
> It should be kept in mind, however, that Matlab's matrix object is
> used
> successfully by a lot of people and should not be dismissed as
> irrelevant.
Matlab's approach is fine for Matlab, of course. All I am saying is
that it is a misfit for Python. Just like 1-based indexing is used
successfully by lots of Fortran programmers, but would be an eternal
source of confusion if it were introduced for a specific container
object in Python.
Konrad.
More information about the Numpy-discussion
mailing list