[Numpy-discussion] Numeric3

konrad.hinsen at laposte.net konrad.hinsen at laposte.net
Tue Feb 8 11:22:49 EST 2005


On 08.02.2005, at 19:27, Chris Barker wrote:

> Well, I HOPE it means:
>
> An environment in which you can do most of what you can do with  
> MATLAB, just as easily, but with a more pythonic approach. I wanted a  
> MATLAB like language, I'd use MATLAB (or maybe Octave or Psilab).

Me too!

> However, internally, what's going on is something like:
>
> 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.

> always returns a NumPy array, regardless of the type of the input. How  
> often are you using arbitrary python sequences anyway? In my case, I  
> am

Much less now than in the early days of NumPy, when there was little  
existing code that worked with arrays for obvious reasons. I had a  
small library of numerical operations using lists from the era before  
NumPy, so I was quite happy to be able to interface this easily. But  
that was 10 years ago, none of that code is left unchanged by now.

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.

But I agree that syntactic sugar should be optional and not influence  
basic library design. It is perfectly possible to have an array method  
take() and in addition a syntactic sugar function from some optional  
module for the people who prefer that.

> Well, this turned out to be too much of a rant, but the basic gist  
> was: let's make SciPy Pythonic, rather than Matlaby. And the same goes  
> for Numeric3.

+1

Konrad.
--
------------------------------------------------------------------------ 
-------
Konrad Hinsen
Laboratoire Leon Brillouin, CEA Saclay,
91191 Gif-sur-Yvette Cedex, France
Tel.: +33-1 69 08 79 25
Fax: +33-1 69 08 82 61
E-Mail: khinsen at cea.fr
------------------------------------------------------------------------ 
-------





More information about the NumPy-Discussion mailing list