Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion wfdb/io/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,10 @@ def convert_label_attribute(self, source_field, target_field, inplace=True,
label_map = self.create_label_map(inplace=False)
label_map.set_index(label_map[source_field].values, inplace=True)

target_item = label_map.loc[getattr(self, source_field), target_field].values
try:
target_item = label_map.loc[getattr(self, source_field), target_field].values
except KeyError:
target_item = label_map.reindex(index=getattr(self, source_field), columns=[target_field]).values.flatten()

if target_field != 'label_store':
# Should already be int64 dtype if target is label_store
Expand Down