I'm reading in large sets of data from an .h5 file, (200,000 points per dataset) and I currently don't need all of it so what I've been doing is reading in the data, then truncating it after.
Is there a way to only read the first X items of an h5 dataset?Answer1:
import numpy as np import h5py filename = 'file.hdf5' f = h5py.File(filename, 'r') key = list(f.keys()) data = list(f[key])
Indexing may vary for
 is an arbitrary dataset of
 is just an arbitrary column I grabbed.