Closed MRossol closed 4 years ago
h5pyd and h5py handle the following slicing differently:
with h5py.File(path, 'r') as f: data = f['dataset'][:, :1]
data.shape -> (n, 1)
with h5pyd.File(path, 'r') as f: data = f['dataset'][:, :1]
data.shape => (n)
Example:
path = '/datasets/NSRDB/v3/nsrdb_2013.h5' with h5py.File(path, 'r') as f: dni = f['dni'][:, :1]
array([[443.], [530.], [528.], ..., [698.], [698.], [698.]], dtype=float32)
path = '/nrel/nsrdb/v3/nsrdb_2013.h5' with h5pyd.File(path, 'r') as f: dni = f['dni'][:, :1]
array([443., 530., 528., ..., 698., 698., 698.], dtype=float32)
I had the impression that h5py reduced the number of dimensions by removing single dimensions in this case. It must have been a previous version...
Anyway, that above commit should make the slicing compatible.
h5pyd and h5py handle the following slicing differently:
data.shape -> (n, 1)
data.shape => (n)
Example:
array([[443.], [530.], [528.], ..., [698.], [698.], [698.]], dtype=float32)
array([443., 530., 528., ..., 698., 698., 698.], dtype=float32)