How to dynamically access Numeric subarrays

Gaubitzer Erwin a9605473 at unet.univie.ac.at
Tue Aug 3 07:29:44 EDT 2004


Hi there

I wrote a short program which reads scientific data from
a file and stores its values in a Numeric array.
At the same time it reads the names of its dimensions which
are then in the same order as the indices of the Numeric
array.

After then I want to access the data in the array by its name
the way that I keep all indices at constant values except the
one I want to read out which I am slicing.

The problem is that the input data varies in its dimensions
so my wanted data can appear at different positions of the
array. I tried to create a list with the slice on the appropriate position
to use it as indices list in the array but this failed.

So my questions to out there:
How can I extract a (Numeric Python) subarray whose indices
have to be built dynamically.

Thanks in advance

Erwin



More information about the Python-list mailing list