Python Forum
Can the data types be different for different columns? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Can the data types be different for different columns? (/thread-29134.html)



Can the data types be different for different columns? - Robotguy - Aug-19-2020

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))



RE: Can the data types be different for different columns? - buran - Aug-19-2020

what library is this? I guess you should check respective docs...


RE: Can the data types be different for different columns? - Robotguy - Aug-19-2020

I am using PyTables-which is built on top of the HDF5 library.