biosiglive.file_io package
Submodules
biosiglive.file_io.save_and_load module
- biosiglive.file_io.save_and_load.load(filename, number_of_line=None, merge=True)[source]
This function reads data from a pickle file to concatenate them into one dictionary.
- Parameters:
filename (str) – The path to the file.
number_of_line (int) – The number of lines to read. If None, all lines are read.
merge (bool) – If True, the data are merged into one dictionary. If False, the data are returned as a list of dictionaries.
- Returns:
data – The data read from the file.
- Return type:
dict
- biosiglive.file_io.save_and_load.load_old(filename, number_of_line=None, merge=True)[source]
This function reads data from a pickle file to concatenate them into one dictionary.
- Parameters:
filename (str) – The path to the file.
number_of_line (int) – The number of lines to read. If None, all lines are read.
merge (bool) – If True, the data are merged into one dictionary. If False, the data are returned as a list of dictionaries.
- Returns:
data – The data read from the file.
- Return type:
dict
- biosiglive.file_io.save_and_load.save(data_dict, data_path, add_data=False, safe=True, compress=False)[source]
This function adds data to a pickle file. It not open the file, but appends the data to the end, so it’s fast.
- Parameters:
data_dict (dict) – The data to be added to the file.
data_path (str) – The path to the file. The file must exist.
add_data (bool, optional) – If True, the data are added to the file. If False, the file is overwritten. The default is False.
safe (bool, optional) – If True, the data are saved in a new file. The default is False.
compress (bool, optional) – If True, the data are compressed. The default is False.