[Numpy-discussion] Numeric3

Gary Strangman strang at nmr.mgh.harvard.edu
Tue Feb 8 11:48:23 CST 2005


>> b = Numeric.asarray(a)
>> at = Numeric.transpose(b)
>> 
>> Is it really so hard to write that extra line? Remember that transpose()
>
> For interactive work, yes. In particular since arrays have no special input 
> notation, you have to type array(...) every time.

Konrad hits the nail on the head, IMHO. I use interactive mode ALL the 
time (as would many converts from, e.g., Matlab). Lots of additional 
typing would greatly limit the usefulness of interactive mode and, for me, 
discourage use of python for numerics.

> Another argument for function style code is habit. I suppose few of us would 
> want to write x.sin() instead of sin(x). The habits are probably less strong 
> for array structure operations, but still for many of us functions are more 
> familiar for mathematical stuff.

And, if there's any desire to attract folks from (e.g.) Matlab (maybe 
there isn't), a function-style approach is needed. This wouldn't have to 
be the *only* implemented approach, but I would strongly (+10) favor 
having the function notation available. 'course, I majored in math, so 
sin(x) is the only notation I'd recognize. ;-)

-best
Gary




More information about the Numpy-discussion mailing list