Python Forum

Full Version: Can the data types be different for different columns?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Everyone,

I create an expandable earray of Nx4 columns. Some columns require float64 datatypes, the others can be managed with int32. Is it possible to vary the data types among the columns? Right now I just use one (float64, below) for all, but it takes huge disk space for (>10 GB) files.

Foe example, how can I mention column 1-2 elements are int32 and 3-4 elements are float64?

a = f1.create_earray(f1.root, "dataset_1", atom=tables.Float32Atom(), shape=(0, 4))
what library is this? I guess you should check respective docs...
I am using PyTables-which is built on top of the HDF5 library.