From 43cf0778dd4d2edf7fc0baa08951f8237044430b Mon Sep 17 00:00:00 2001 From: Brian Gow Date: Mon, 13 Oct 2025 12:28:09 -0400 Subject: [PATCH] fix test overflow error --- wfdb/io/annotation.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/wfdb/io/annotation.py b/wfdb/io/annotation.py index 7e75026e..5edd32a4 100644 --- a/wfdb/io/annotation.py +++ b/wfdb/io/annotation.py @@ -908,7 +908,18 @@ def create_label_map(self, inplace=True): if self.custom_labels is not None: self.standardize_custom_labels() for i in self.custom_labels.index: - label_map.loc[i] = self.custom_labels.loc[i] + # label_map.loc[i] = self.custom_labels.loc[i] + label_map["label_store"] = label_map["label_store"].astype( + "int64" + ) + cl = self.custom_labels.astype( + {"label_store": "int64"} + ).set_index("label_store") + lm = label_map.set_index("label_store").reindex( + label_map["label_store"].unique() + ) + lm.update(cl[["symbol", "description"]]) + label_map = lm.reset_index() if inplace: self.__label_map__ = label_map