Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
342 views
in Technique[技术] by (71.8m points)

pandas - Is there a pythonic way to fetch keys from an h5 file without loading the complete data file?

Is there a pythonic way to read-only the keys from an h5 file without loading the complete data? I have tried h5py and pandas HDFStore (as shown below):

h5py

f = h5py.File(filename, 'r')
h5_keys = list(f.keys()) 

pandas HDFStore

with pd.HDFStore(filename) as hdf:
    keys = hdf.keys()

but both methods are very slow, especially when the h5 file is very large.

question from:https://stackoverflow.com/questions/66052430/is-there-a-pythonic-way-to-fetch-keys-from-an-h5-file-without-loading-the-comple

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...