Proposal: add vector arithmetic to array module

Chris Barker chrishbarker at home.net
Mon Sep 24 17:06:00 EDT 2001


Paul Rubin wrote:
> It seems almost unnatural that given two arrays of the same type
> of element and the same length, I can't say "a = b + c" and get
> the arrays added together element-wise.  There's various algorithms
> I'd be able to speed up quite a bit that way.

You're right, it is unnatural
 
> Please suppress the urge to reply "use NumPy".

I'm sorry, but I can't suppress it. NumPy is so clearly what you want
here.

> Numpy is a big package

It's not that big.

> that's not part of standard Python

It should be.

with a lot of PDF documentation

Since when is lots of good documentation a BAD thing???????

> and most importantly needs to be installed separately.

That kind of follows from it not being in the standard library.

> That makes it
> a lot harder to distribute applications to non-technical users.  It's
> bad enough that they already have to install Python to run Python apps.

Sort of. As you say, Python has to be installed, and the correct
version, and all that. Given that, many folks have chosen to use Py2exe
or McMillan's Istaller for distributing Python apps. with these tools,
youcan just give them NumPy along with the rest.

For that matter, there is something of a push to create a "batteries and
accessories included" approach to installing Python. ActiveState has
made a start of this with their distribution and pyppm. I have started a
project alnong these lines as well, but havn't gotten far because no one
else seems to think it's worth it. I still, do, but I lost a lot of
motivation.

Which is easier:

Adding a bunch of functionality to a standard module.

Making a widely used, robust, and powerfull module standard.

Personally, I think we should go beyond making NumPy a standard module,
and make NumPy Arrays a built-in type.

-Chris







-- 
Christopher Barker,
Ph.D.                                                           
ChrisHBarker at home.net                 ---           ---           ---
http://members.home.net/barkerlohmann ---@@       -----@@       -----@@
                                   ------@@@     ------@@@     ------@@@
Oil Spill Modeling                ------   @    ------   @   ------   @
Water Resources Engineering       -------      ---------     --------    
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------



More information about the Python-list mailing list