Group#
- class h5pandas.Group(group_id, columns=None)[source]#
h5py Group that provides a DataFrame instead of dataset.
See h5py documentation: https://docs.h5py.org/en/stable/high/group.html
- create_dataset(name, shape=None, dtype=None, data=None, index: list | None | Index = None, columns: list[str] | None = None, metadata: dict = {}, **kwargs)[source]#
Create a dataset.
If columns is provided or if data is a DataFrame, the columns names are written as attribute of the dataset. If data is a DataFrame, its attributes (data.attrs) are saved into the dataset attributes so that they can be retrieve later with h5pandas. If metadata is provided, it is written inside the dataset attributes. If metadata as the same key as data.attrs, metadata will be written in the file.
See h5py documentation: https://docs.h5py.org/en/stable/high/dataset.html
Parameters#
- name: str
Name of the dataset (absolute or relative). Provide None to make an anonymous dataset.
- shape
Dataset shape. Use “()” for scalar datasets. Required if “data” isn’t provided.
- dtype
Numpy dtype or string. If omitted, dtype(‘f’) will be used. Required if “data” isn’t provided; otherwise, overrides data array’s dtype.
- data
Provide data to initialize the dataset. If used, you can omit shape and dtype arguments.
- index: list, None or pandas.Index, optional
Default=None. If not None, index will be written inside the HDF5 file and can be retrieve later with h5pandas.
- columns: list, optional
names of the columns of the array to save, if any. If the array is a structured array and columns is none then structured names are used. Otherwise, if None, then nothing is written.
- metadatadict, optional
Additional metadata to save with the dataset attributes.
Keyword-only arguments:
Returns#
- pandas.DataFrame
The newly create DataFrame.
- class h5pandas.File(name, mode='r', driver=None, libver=None, userblock_size=None, swmr=False, rdcc_nslots=None, rdcc_nbytes=None, rdcc_w0=None, track_order=None, fs_strategy=None, fs_persist=False, fs_threshold=1, fs_page_size=None, page_buf_size=None, min_meta_keep=0, min_raw_keep=0, locking=None, alignment_threshold=1, alignment_interval=1, meta_block_size=None, *, track_times=False, **kwds)[source]#
h5py File that provides a DataFrame instead of dataset.
See h5py documentation: https://docs.h5py.org/en/stable/high/file.html