larray.read_hdf

larray.read_hdf(filepath_or_buffer, key, fill_value=nan, na=nan, sort_rows=False, sort_columns=False, name=None, **kwargs)[source]

Reads an axis or group or array named key from a HDF5 file in filepath (path+name)

Parameters
filepath_or_bufferstr or pandas.HDFStore

Path and name where the HDF5 file is stored or a HDFStore object.

keystr or Group

Name of the array.

fill_valuescalar or LArray, optional

Value used to fill cells corresponding to label combinations which are not present in the input. Defaults to NaN.

sort_rowsbool, optional

Whether or not to sort the rows alphabetically. Must be False if the read array has been dumped with an larray version >= 0.30. Defaults to False.

sort_columnsbool, optional

Whether or not to sort the columns alphabetically. Must be False if the read array has been dumped with an larray version >= 0.30. Defaults to False.

namestr, optional

Name of the axis or group to return. If None, name is set to passed key. Defaults to None.

Returns
LArray

Examples

>>> fname = get_example_filepath('examples.h5')

Read array by passing its identifier (key) inside the HDF file

>>> # The data below is derived from a subset of the demo_pjan table from Eurostat
>>> read_hdf(fname, 'pop')
country  gender\time      2013      2014      2015
Belgium         Male   5472856   5493792   5524068
Belgium       Female   5665118   5687048   5713206
 France         Male  31772665  31936596  32175328
 France       Female  33827685  34005671  34280951
Germany         Male  39380976  39556923  39835457
Germany       Female  41142770  41210540  41362080