gpt4 book ai didi

python - 记录心电图数据到文本文件

转载 作者:太空宇宙 更新时间:2023-11-04 09:23:30 24 4
gpt4 key购买 nike

我拥有的原始 ECG 是 csv 格式。我需要将其转换为只有 ECG 数据的 .txt 文件。我需要一个 python 代码。我能得到一些帮助吗?

csv_file = 'ECG_data_125Hz_Simulator_Patch_Normal_Sinus.csv'
txt_file = 'ECG_data_125Hz_Simulator_Patch_Normal_Sinus.txt'
import csv
with open(txt_file, "w") as my_output_file:
with open(csv_file, "r") as my_input_file:
//need to write data to the output file
my_output_file.close()

输入的 ECG 数据如下所示: Raw_ECG_data

最佳答案

什么对我有用

import csv
csv_file = 'FL_insurance_sample.csv'
txt_file = 'ECG_data_125Hz_Simulator_Patch_Normal_Sinus.txt'
with open(txt_file, "w") as my_output_file:
with open(csv_file, "r") as my_input_file:
[ my_output_file.write(" ".join(row)+'\n') for row in csv.reader(my_input_file)]
my_output_file.close()

关于python - 记录心电图数据到文本文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58931469/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com