fino2py.cleaning package
Submodules
fino2py.cleaning.merge_split_data module
Append cardiovascular data from a second file to a first file and optionally write the combined data to a new file. In some cases, due to issue with the finometer during data collection, a single participant may end up with two seperate folders with seperate .txt files. This module provides a function to append the cardiovascular data from a ‘part 2’ file to a ‘part 1’ file. The combined data is returned as a list of strings. Optionally, the function can write the combined data to an output file.
Notes
This function is intended for use in the data cleaning process, but it should be used cautiously and documented appropriately in the research notes and final report appendices.
The function is not intended to be used to combine data from two seperate participants.
Example
combined_data = merge_split_data(‘/path/to/part1_file.txt’, ‘/path/to/part2_file.txt’, part2_start_line=9, output_file=’/path/to/output_file.txt’)
- fino2py.cleaning.merge_split_data.merge_split_data(part1_file: str | Path, part2_file: str | Path, part2_start_line: str = 9, output_file: str | Path | None = None) List[str][source]
Appends cardiovascular data from part 2 file to part 1 file and optionally writes the combined data to an output file.
- Parameters:
part1_file (Union[str, Path]) – File path of the part 1 file.
part2_file (Union[str, Path]) – File path of the part 2 file.
part2_start_line (int, optional) – The line number in the part 2 file from which to start appending the data (default is 9). Use this parameter to skip lines in the part 2 file, for example, to account for recalibration.
output_file (Union[str, Path], optional) – File path of the output file to write the combined data (default is None).
- Returns:
List of combined cardiovascular data.
- Return type:
List[str]