修复PSG_label_2_BCG_label.py脚本中的一个关于路径的小bug

This commit is contained in:
Yorusora 2025-01-14 23:57:49 +08:00
parent bd026d1895
commit 8370bffdbb

View File

@ -9,8 +9,7 @@ def get_time_to_seconds(time_str):
base_event = ["Hypopnea", "Central apnea", "Obstructive apnea", "Mixed apnea"]
# 输入设置(每次运行此脚本都必须检查)
dir_path = Path(r"E:\data_annotation\6SleepApnea_annotation_GUI_demo\data")
dir_path = Path(r"D:\code\data")
PSG_Data_Path = dir_path / "PSG"
PSG_Label_Path = dir_path / "PSG_label"
BCG_Data_Path = dir_path / "BCG"
@ -37,7 +36,7 @@ for sampID in sampIDs:
df_PSG_label['End'] = df_PSG_label['Start'] + df_PSG_label['Duration'].astype(float).round(0).astype(int)
# 写入csv文件
df_PSG_label.to_csv(dir_path.name + r"\BCG_label\export" + str(sampID) + "_all.csv", index=False, encoding="gbk")
df_PSG_label.to_csv(str(dir_path) + r"\BCG_label\export" + str(sampID) + "_all.csv", index=False, encoding="gbk")
# 打印结果
print("sampID_" + str(sampID) + "写入csv成功")