dask.array.to_hdf5

dask.array.to_hdf5(filename, *args, chunks=True, **kwargs)[source]

Store arrays in HDF5 file

This saves several dask arrays into several datapaths in an HDF5 file. It creates the necessary datasets and handles clean file opening/closing.

Parameters
chunks: tuple or ``True``

Chunk shape, or True to pass the chunks from the dask array. Defaults to True.

See also

da.store
h5py.File.create_dataset

Examples

>>> da.to_hdf5('myfile.hdf5', '/x', x)  

or

>>> da.to_hdf5('myfile.hdf5', {'/x': x, '/y': y})  

Optionally provide arguments as though to h5py.File.create_dataset

>>> da.to_hdf5('myfile.hdf5', '/x', x, compression='lzf', shuffle=True)  
>>> da.to_hdf5('myfile.hdf5', '/x', x, chunks=(10,20,30))  

This can also be used as a method on a single Array

>>> x.to_hdf5('myfile.hdf5', '/x')