I am saving some data to HDF5 file via h5py. They are mixed-types data, some are proper numpy arrays, many are scalars or strings. Scalars and strings get "encoded" to numpy arrays by h5py automatically (that is very nice), but I would like to do the reverse now: when reading those data, get it converted to native python type, instead of seeing scalars as 0d shapes, strings as <HDF5 dataset "plots": shape (), type "|S207"> and such.
Is there an easy way to achieve that, without me having to check for array dtype manually?
It is fine that an extra object will be created for every conversion.