Skip to content

Incompatible with pandas==3.0.0 #560

@PierreGtch

Description

@PierreGtch

Hello, I noticed the library was incompatible with pandas==3.0:

conda create -n wfdb python=3.12 -y
conda activate wfdb
pip install wfdb pandas==3.0.0

Then in python, just import wfdb gives:

Traceback (most recent call last):
  File "/Users/Pierre.Guetschel/miniforge3/envs/wfdb/lib/python3.12/site-packages/pandas/core/frame.py", line 6967, in set_index
    found = col in self.columns
            ^^^^^^^^^^^^^^^^^^^
  File "/Users/Pierre.Guetschel/miniforge3/envs/wfdb/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 5369, in __contains__
    hash(key)
TypeError: unhashable type: 'StringArray'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/Pierre.Guetschel/miniforge3/envs/wfdb/lib/python3.12/site-packages/wfdb/__init__.py", line 1, in <module>
    from wfdb.io.record import (
  File "/Users/Pierre.Guetschel/miniforge3/envs/wfdb/lib/python3.12/site-packages/wfdb/io/__init__.py", line 16, in <module>
    from wfdb.io.annotation import (
  File "/Users/Pierre.Guetschel/miniforge3/envs/wfdb/lib/python3.12/site-packages/wfdb/io/annotation.py", line 3060, in <module>
    ann_class_table.set_index(ann_class_table["extension"].values, inplace=True)
  File "/Users/Pierre.Guetschel/miniforge3/envs/wfdb/lib/python3.12/site-packages/pandas/core/frame.py", line 6969, in set_index
    raise TypeError(
TypeError: The parameter "keys" may be a column key, one-dimensional array, or a list containing only valid column keys and one-dimensional arrays.. Received column of type <class 'pandas.arrays.StringArray'>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions