Python Forum
Can the data types be different for different columns?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can the data types be different for different columns?
#1
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))
Reply
#2
what library is this? I guess you should check respective docs...
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Data types changing by itself dimas 2 659 Oct-30-2023, 06:11 PM
Last Post: dimas
  Training a model to identify specific SMS types and extract relevant data? lord_of_cinder 0 955 Oct-10-2022, 04:35 AM
Last Post: lord_of_cinder
  import columns of data from local csv file CatherineKan 2 3,302 May-10-2021, 05:10 AM
Last Post: ricslato
  pandas.to_datetime: Combine data from 2 columns ju21878436312 1 2,421 Feb-20-2021, 08:25 PM
Last Post: perfringo
  how to filter data frame dynamically with the columns psahay 0 2,379 Aug-24-2020, 01:10 PM
Last Post: psahay
  manipulating .csv file into columns of selected data Karen_Masila 2 2,881 Feb-14-2018, 06:50 AM
Last Post: Karen_Masila
  Replacing values for specific columns in Panda data structure Padowan 1 14,637 Nov-27-2017, 08:21 PM
Last Post: Padowan
  Removing characters from columns in data frame kiton 15 58,245 Apr-17-2017, 07:01 PM
Last Post: zivoni

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020