[PYTHON MATRIX-SIG] Efficient data reading

Konrad HINSEN hinsenk@ere.umontreal.ca
Wed, 6 Mar 1996 09:14:41 -0500


> the headers, its  the 2 MB data arrays I'm worried about.  I'm thinking about 
> reading the data using the array module, and feeding the result of that to the
> Numerical module. Is that reasonably efficient?  It seems like I'll have 2  
> copies floating around for a moment. Is there another mechanism
> in the Numerical module that I'm missing?  

There is no difference between the "array module" and the "numerical module".
The module "Numerical" simply imports objects from the array module. Or are
you referring to the old array module?

I see no problem in writing a C function that allocates the array and
loads the data without any copying. However, you will have to take
care that this array is not copied during later processing. Python
is not exactly designed to avoid copying objects.

-------------------------------------------------------------------------------
Konrad Hinsen                     | E-Mail: hinsenk@ere.umontreal.ca
Departement de chimie             | Tel.: +1-514-343-6111 ext. 3953
Universite de Montreal            | Fax:  +1-514-343-7586
C.P. 6128, succ. Centre-Ville     | Deutsch/Esperanto/English/Nederlands/
Montreal (QC) H3C 3J7             | Francais (phase experimentale)
-------------------------------------------------------------------------------

=================
MATRIX-SIG  - SIG on Matrix Math for Python

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