Skip to content

Commit 48d3f9e

Browse files
authored
Fix for pandas 3.0 (#561)
A minimal fix to get `import wfdb` working again with pandas 3.0+. Not sure if others are required. Happy to iterate further with tests etc. as needed, or close if someone else is already working on a fix! Closes #560
2 parents 5ddb1df + d70cdc1 commit 48d3f9e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

wfdb/io/annotation.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,7 @@ def convert_label_attribute(
14691469
return
14701470

14711471
label_map = self.create_label_map(inplace=False)
1472-
label_map.set_index(label_map[source_field].values, inplace=True)
1472+
label_map.set_index(keys=pd.Index(label_map[source_field].values), inplace=True)
14731473

14741474
try:
14751475
target_item = label_map.loc[
@@ -3057,7 +3057,10 @@ def __init__(self, extension, description, human_reviewed):
30573057
"human_reviewed": [ac.human_reviewed for ac in ann_classes],
30583058
}
30593059
)
3060-
ann_class_table.set_index(ann_class_table["extension"].values, inplace=True)
3060+
ann_class_table.set_index(
3061+
keys=pd.Index(ann_class_table["extension"].values),
3062+
inplace=True,
3063+
)
30613064
ann_class_table = ann_class_table[
30623065
["extension", "description", "human_reviewed"]
30633066
]

0 commit comments

Comments
 (0)