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

未关闭
#487 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
pandas, python
领域
data

调研方向

从 annotation.py 中的 get_contained_labels 开始,重点检查 1335-1355 行附近的索引操作,并检查其他使用基于 set 的 label_map 索引的位置。使用 pandas 2.1.3 或更高版本验证受影响的 annotation 访问路径;当不再引发 set-indexer TypeError 时即表示完成。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Jupyter Notebook
星标
853
派生
322
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

MIT-LCP/wfdb-python 的其他 Issue

查看 MIT-LCP/wfdb-python 的全部 Issue

相似的 Issue

更多 Data Engineering Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。