|
From: Andreas H. <li...@hi...> - 2013-01-23 15:38:48
|
Hi,
how can I use Python's built-in `slice` object on CArray? Currently, I'm
trying
In: coord_slice
Out: [slice(0, 31, None), slice(0, 5760, None), slice(0, 2880, None)]
In: _ds
Out: /data/mydata (CArray(31, 5760, 2880), shuffle, blosc(5)) ''
atom := Float32Atom(shape=(), dflt=0.0)
maindim := 0
flavor := 'numpy'
byteorder := 'little'
chunkshape := (1, 45, 2880)
In: _ds[coord_slice]
Out: *** TypeError: long() argument must be a string or a number,
not 'slice'
The problem is that I want to write something generic, and I don't know
beforehand how many dimensions the CArray has. My current plan is to
create a tuple of slice objects programatically (using list
comprehension), and then use this tuple as index. But apparently it
doesn't work with pytables 2.3.1.
Any suggestions on how to accomplish my task are greatly appreciated :)
Cheers, Andreas.
|