larray.Session.to_hdf

Session.to_hdf(fname, names=None, overwrite=True, display=False, **kwargs)[source]

Dumps all array objects from the current session to an HDF file.

Parameters:

fname : str

Path for the dump.

names : list of str or None, optional

List of names of objects to dump. Defaults to all objects present in the Session.

overwrite: bool, optional

Whether or not to overwrite an existing file, if any. If False, file is updated. Defaults to True.

display : bool, optional

Whether or not to display which file is being worked on. Defaults to False.

Examples

>>> arr1, arr2, arr3 = ndtest((2, 2)), ndtest(4), ndtest((3, 2))   
>>> s = Session([('arr1', arr1), ('arr2', arr2), ('arr3', arr3)])  

Save all arrays

>>> s.to_hdf('output.h5')  

Save only some arrays

>>> s.to_hdf('output.h5', ['arr1', 'arr3'])