Skip to content

Commit 43cf077

Browse files
committed
fix test overflow error
1 parent a629039 commit 43cf077

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

wfdb/io/annotation.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,18 @@ def create_label_map(self, inplace=True):
908908
if self.custom_labels is not None:
909909
self.standardize_custom_labels()
910910
for i in self.custom_labels.index:
911-
label_map.loc[i] = self.custom_labels.loc[i]
911+
# label_map.loc[i] = self.custom_labels.loc[i]
912+
label_map["label_store"] = label_map["label_store"].astype(
913+
"int64"
914+
)
915+
cl = self.custom_labels.astype(
916+
{"label_store": "int64"}
917+
).set_index("label_store")
918+
lm = label_map.set_index("label_store").reindex(
919+
label_map["label_store"].unique()
920+
)
921+
lm.update(cl[["symbol", "description"]])
922+
label_map = lm.reset_index()
912923

913924
if inplace:
914925
self.__label_map__ = label_map

0 commit comments

Comments
 (0)