As noted by the APS USAXS, consider this algorithm to access scalar values in HDF5 files:
if dataset.shape == (1, ): # historical representation of scalar value
value = dataset[0]
elif dataset.shape == (): # scalar representation
value = dataset.value
else: # array of some sort
value = numpy.array(dataset)
As noted by the APS USAXS, consider this algorithm to access scalar values in HDF5 files: