[MATRIX-SIG] Much ado about nothingness.

Zane C. Motteler motteler@laura.llnl.gov
Tue, 8 Jul 1997 12:50:23 -0700 (PDT)


Hi Hoon,

I've been following your correspondence with Aaron. It seems to me that 
you are missing an important concept in criticizing NumPy (and other    
Python functions) for not dealing with None.

The primary purpose in creating Numerical arrays is to have a PyObject  
containing contiguous numerical data that can be rapidly processed in
compiled code. The elements of a NumPy array must ipso facto all be
numbers of the same type (e. g., real, integer, etc.). None, however, is
not a number of any type but rather is a PyObject. This it seems as if
you are asking for NumPy arrays which may contain elements of different
types. But if you want arrays which contain objects of different types,
then a Python list is about all we have available, and then of course
you don't have handy matrix operations, etc.

It seems to me that if you want array-like objects that can contain
PyObjects as well as numbers, and yet can somehow meaningfully have
array functions and operations applied to them, then you need your own
Python extension defining a new type. You can write your own or hire    
somebody to do it.... ;-} (I could, I think it would be an interesting  
exercise, but I don't have the time....)

NumPy was designed just for one purpose, namely to do fast numerical    
calculations with non-sparse arrays containing objects of just one   
numerical type. I think what you are asking for is a horse of a
different color.

I hope that I have helped to clarify matters rather than muddy the
Watters. (Oops, pardon the pun, Aaron.)

Cheers

Zane

-----------------------------------------------------------------------------
Zane C. Motteler, Ph. D.                  ___________ALSO:_________________
Computer Scientist                        | Professor Emeritus of Computer|
Lawrence Livermore National Laboratory    |   Science and Engineering     |
P O Box 808, L-472                        | California Polytechnic State  |
Livermore, CA 94551-9900                  |   University, San Luis Obispo |
510/423-2143                              ---------------------------------
FAX 510/423-9969
zcm@llnl.gov or motteler@laura.llnl.gov or zmottel@calpoly.edu


_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________