MIT-LCP / MIT-LCP/wfdb-python

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

Open
#487 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
853
Forks
322
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in annotation.py at get_contained_labels, especially the indexing around lines 1335-1355, and inspect other occurrences of set-based label_map indexing. Verify the affected annotation access path with pandas 2.1.3 or later; done means it no longer raises the set-indexer TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.