From 08bcbb4b281cb6c72fc20b6edc09741983d5762d Mon Sep 17 00:00:00 2001 From: marques <20172333133@m.scnu.edu.cn> Date: Fri, 25 Jul 2025 16:50:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=8E=92SA=E6=A0=87=E7=AD=BE=E7=9A=84?= =?UTF-8?q?=E7=B4=A2=E5=BC=95=EF=BC=8C=E4=BB=8E1=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E5=B9=B6=E5=91=BD=E5=90=8D=EF=BC=8C=E5=90=8C=E6=97=B6=E6=8C=89?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E6=97=B6=E9=97=B4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- func/Module_cut_PSG.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/func/Module_cut_PSG.py b/func/Module_cut_PSG.py index a9574cf..5f87e88 100644 --- a/func/Module_cut_PSG.py +++ b/func/Module_cut_PSG.py @@ -335,6 +335,11 @@ class Data: for key, raw in self.raw.items(): DataFrame(raw.reshape(-1)).to_csv(Path(Config["Path"]["SaveFolder"]) / Path((Config["ChannelSave"][key] + str(self.freq[key]) + Config["EndWith"][key])), index=False, header=False) + # 重排index,从1开始,并给index命名 + self.SALabel.reset_index(drop=True, inplace=True) + self.SALabel.index = self.SALabel.index + 1 + self.SALabel.index.name = "Index" + self.SALabel.sort_values(by=["Start"], inplace=True) self.SALabel.to_csv(Path(Config["Path"]["SaveFolder"]) / Path((Config["LabelSave"]["SA Label"] + Config["EndWith"]["SA Label"])), encoding="gbk") except PermissionError as e: