[Numpy-discussion] Numeric3

Peter Verveer verveer at embl.de
Sun Feb 6 14:52:10 CST 2005


On Feb 6, 2005, at 7:33 PM, Stephen Walton wrote:

> Peter Verveer wrote:
>
>>
>> On Feb 6, 2005, at 5:41 PM, konrad.hinsen at laposte.net wrote:
>>
>>> My personal approach is that operations should be expressed in terms 
>>> of problem-specific classes in which the internal use of arrays is 
>>> an implementation detail.
>>>
>>> There are arguments for and against both approaches, and I think 
>>> there is space (meme space) for both.
>>
>>
>> That more or less sums up my approach too. I tend to program in a mix 
>> of these two approaches.
>
> I'm both largely a lurker here and a Python naif, at least when it 
> comes to the more object oriented aspects.  I'd be interested in 
> seeing snippets of code illustrating the second approach here, as 
> opposed to the array oriented approach with which I'm familiar.

I guess it it a bit hard just to give a snippet, but maybe I can 
explain what it means for me. I use numarray mainly as part of 
implementing command-line programs that perform specific data analysis 
tasks. So python with numarray replaced for me what used to done in C 
or Fortran. To make the code reusable and flexible I use the 
programming constructs that Python offers, like classes and such. 
Obviously array orient numerics remains a part of that, you have to get 
the actual calculations done using the array functions. I usually have 
the array part still exposed at some level, but from what Konrad said, 
it appears he takes that a step further and he hides the actual 
mechanics of doing the calculations with arrays completely away.

I suppose most people that use python+numarray/numeric will do this to 
differents extents, but I guess many people like to have a more 
interactive enviroment, where you can type your commands and see the 
results straight away, which I guess matlab is very good at. I don't do 
that much, I prefer to design and write a program that does the task 
that needs to be done. Python+numarray provide a great programming 
language compared to C or Fortran in terms of programmer productivity. 
In this light, it may be understandable that I am not so much 
interested in having a python based numerical enviroment as much as in 
having a good repository of numeric algorithms that I can use in my 
programs.

Peter





More information about the Numpy-discussion mailing list