I have a csv file which has "Date","Time" and other columns (10 or so)
Date,Time,C
20020515,123000000,10293
20020515,160000000,10287
20020516,111800000,10270
20020516,160000000,10260
20020517,130500000,10349
20020517,160000000,10276
20020520,123700000,10313
20020520,160000000,10258
20020521,114500000,10223
I am trying to load this into a hdf5 file and have Date and Time type be "String" and not integer32. So I am doing this
import h5py,numpy as np
my_data = np.genfromtxt("/tmp/data.txt",delimiter=",",dtype=None,names=True)
myFile="/tmp/data.h5"
with h5py.File(myFile,"a") as f:
dset = f.create_dataset('foo',data=my_data)
I would like to store "Date" and "Time" as type "String" on HDF5. Not Int32.
Datasets are very similar to NumPy arrays. They are homogenous collections of data elements, with an immutable datatype and (hyper)rectangular shape.This means that all columns must have the samedtype.