H5Import and 1 dimensional data


Hi. I am trying to open an HDF5 file in Python using vaex_open() that was created using H5Import. It appears there is no way to create the HDF5 file as a one-dimensional vector. For example, if I use (for a binary file containing 8388608 64-bit floating point numbers in binary format):

h5import data -dims 8388608 -type FP -size 64 -o data.hdf5

And then open the file in Python with:

osc_data = vaex.open(’…/data.hdf5’) [where ‘…’ is the path to the directory containing the file]

And then I print out the dataframe shape:


The result is:

(8388608, 1)

When I try to plot osc_data using vaex’s plot1d() function, Python throws an error that states the data is not 1 dimensional.

If I then flatten the data, using:

osc_data_flattened = osc_data.values.flatten()

and then print out the shape:


the result is:


The resulting numpy array, “osc_data_flattened”, works fine in both vaex’s plot1d() an matplotlib’s plot() function.

Is there any option to H5import that will force the result to be a 1-dimensional array?