A collection of code samples to illustrate reading and writing HDF5 files from Python using the PyTables module.
create_table.py: creates an HDF5 filetest.h5that has a root-level groupparticlescontaining a data setinitialthat holds the particles mass, x- and y-coordinates, x- and y-component of its velocity as floating point numbers, and an ID as an integer value.add_table.py: adds a data setfinalin theparticlesgroup oftest.h5.add_array.py: adds a groupfieldstotest.h5, and inserts an 2D array as data sethiggs. The data is stored as a numpy array.compute_avg.py: reads thehiggsdata set fromtest.h5, as numpy array, and computes the average value of all points.query_table.py: select only the particles in theinitialdata set that have a velocity above a certain threshold, and print them.particle.py: defines a classParticle.test.h5: test HDF5 file.write_large_dataset.py: script to create an HDF5 file with a large dataset, useful to experiment with various forms of reading the dataread_large_dataset.py: script to experiment with various read modes, reading an entire dataset, reading non-contiguous rows and columnsh5py.ipynb: Jupyter notebook illustrating the h5py package.