read_pandas_hdf5

cosmo_utils.utils.file_readers.read_pandas_hdf5(hdf5_file, key=None, ret=False)[source] [edit on github]

Reads a HDF5 file that contains one or many datasets. It converts it into a pandas DataFrame.

Parameters:

hdf5_file : str

Path to the HDF5 file containing one or more pandas DataFrame(s).

key : str or NoneType

If provided, it will extract the key value as a pandas DataFrame. This value is set to None by default.

ret : bool, optional

If True, it returns the value of the key. By default, it is set to False.

Returns:

df : pandas.DataFrame

DataFrame from the hdf5_file with the data from the key directory