LArray.to_hdf(self, filepath, key)[source]

Writes array to a HDF file.

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


Path where the hdf file has to be written.

keystr or Group

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


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.


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

Save an array

>>> a.to_hdf('test.h5', 'a')          # doctest: +SKIP

Save an array in a specific HDF group

>>> a.to_hdf('test.h5', 'arrays/a')  # doctest: +SKIP