[Numpy-discussion] matrix indexing question

Alan Isaac aisaac@american....
Tue Mar 27 00:54:55 CDT 2007


> On 3/27/07, Alan Isaac <aisaac@american.edu> wrote: 
>> May I see a use case where the desired 
>> return when iterating through a matrix 
>> is rows as matrices?  That has never 
>> been what I wanted. 


On Tue, 27 Mar 2007, Bill Baxter wrote: 
> AllMyPoints = mat(rand(100,2)) # 100 two-d points 
> for pt in AllMyPoints: 
>     xformedPt = pt * TransformMatrix 
>     # do something to transformed point 


This seems artificial to me for several reasons,
but here is one reason:
AllxformedPts = AllMyPoints * TransformMatrix

Note that I am no longer disputing the convention,
just trying to understand its usefulness.

Cheers,
Alan Isaac




More information about the Numpy-discussion mailing list