[Numpy-discussion] Release of NumPy

Alan G Isaac aisaac at american.edu
Wed Apr 16 02:08:34 EDT 2008


> On 15/04/2008, Alan G Isaac <aisaac at american.edu> wrote:
>> I thought the context of the discussion had become something 
>>  like this: there is no reason for the matrix interface to
>>  deviate from the array interface except as needed to provide
>>  specific desired functionality.  Essentially,

>>         - matrix multiplication
>>         - powers of square matrices
>>         - submatrix creation

>>  The proposal on the table is to remove an unneeded (and
>>  unwanted) deviation of the matrix API from the ndarray API.
>>  That is all.

On Tue, 15 Apr 2008, Stéfan van der Walt apparently wrote:
> Unless my memory fails me (again), this would result in 
> another deviation from numpy: that x[0] no longer returns 
> the first row of any 2D array (matrix), especially when 
> dealing with matrices of shape of (1,N). 

Either I do not understand you, or this is not correct, or...
Anyway, for matrix x,
x[0] should be the same as the current x.A[0]

> The whole issue occurs because a Matrix is not a proper 
> container.

Right.  And *that* is the case because of the attempt to 
treat matrices as containers of matrices instead of as 
containers of 1d arrays.

I can see no real advantage to having matrices be containers 
of row vectors instead.  A row vector would just be a matrix 
(i.e., essentially 2d) that allowed 1d style indexing.  
Again I ask, have you ever needed such a thing?


> My favorite quote in these threads so far has to be by Charles Harris:
> "All this for want of an operator ;)"

I agree this is a good perspective.  (But *two* operators: * and **.)
It implies: there are deviations from array behavior that 
are buying us nothing.  This is my point.

Cheers,
Alan






More information about the NumPy-Discussion mailing list