larray.Array.to_hdf

Array.to_hdf(filepath, key) None[source]

Write array to a HDF file.

A HDF file can contain multiple arrays. The ‘key’ parameter is a unique identifier for the array.

Parameters
filepathstr or Path

Path where the hdf file has to be written.

keystr or Group

Key (path) of the array within the HDF file (see Notes below).

Notes

Objects stored in a HDF file can be grouped together in HDF groups. If an object ‘my_obj’ is stored in a HDF group ‘my_group’, the key associated with this object is then ‘my_group/my_obj’. Be aware that a HDF group can have subgroups.

Examples

>>> a = ndtest((2, 3))

Save an array

>>> a.to_hdf('test.h5', 'a')          

Save an array in a specific HDF group

>>> a.to_hdf('test.h5', 'arrays/a')