MIT-LCP / wfdb-python

Native Python WFDB package
MIT License
730 stars 298 forks source link

annotation.py:get_contained_labels (1335): pandas throws TypeError: Passing a set as an indexer is not supported. Use a list instead. #487

Open hernot opened 1 month ago

hernot commented 1 month ago

Using python version of libwfdb 4.1.2 which is according to pypi the latest.

Since lately when accessing the annotations i do get the error

TypeError: Passing a set as an indexer is not supported. Use a list instead.

This is caused by passing the following indexing tuple in line

index_vals = {1, 5}
# annotation.py(1355)get_contained_labels
contained_labels = label_map.loc[index_vals, :]

for now i do fix this by replacing the above line by

contained_labels = label_map.loc[list(index_vals), :]

and any further occurence.

The reason is that pandas has droped support for settype index arround version 2.1.3 which i do have currently installed.