I have a list of variables of different types including long strings and I want to put this list into a hdf5 file as a dataset. To my understanding, h5py converts the long strings to ‘<U’ type variables and then throws an error when trying to write it to the file. After searching the internet, I could only find fixes for lists with the same datatype, so I thought to split the list and append each list item to the same dataset but to no avail. Is there a way to work around this?
Is there a reason that you cannot use the same type?
That is, using ‘6’ instead of 6 and ‘23’ instead of 23.
If not, how about splitting the list based on type and append data to 2 different datasets?
For example, 6 and 23 goes to integer dset1 and other strings go to string dset2.