pyheartlib.io

Module Contents

Functions

get_data(record_path, config[, return_dict])

Reads a record and returns its components.

save_data(data, file_path)

Saves the data into a file.

load_data([file_path])

Loads the data from a file.

pyheartlib.io.get_data(record_path, config, return_dict=True)

Reads a record and returns its components.

Parameters:
  • record_path (str) – Path of the record.

  • config (dict) – Config of the dataset.

  • return_dict (bool) – If True, returns a dict, otherwise returns a pandas dataframe.

Returns:

If return_dict is True, it returns a dictionary with keys: signal, r_locations, r_labels, rhythms, rhythms_locations.

If return_dict is False, it returns a dataframe containing the time, raw signal, and a list of equal size to the raw signal with None values except at annotations locations.

Return type:

dict or dataframe

pyheartlib.io.save_data(data, file_path)

Saves the data into a file.

pyheartlib.io.load_data(file_path=None)

Loads the data from a file.