Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrann ValueError #461

Open
toiflm opened this issue Jul 5, 2023 · 1 comment
Open

wrann ValueError #461

toiflm opened this issue Jul 5, 2023 · 1 comment

Comments

@toiflm
Copy link

toiflm commented Jul 5, 2023

When saving annotations, I get this error in wrann:

File "C:\Users\######\venv\Lib\site-packages\wfdb\io\annotation.py", line 943, in wr_ann_file
    if fs_bytes == [] and cl_bytes == []:
       ^^^^^^^^^^^^^^
ValueError: operands could not be broadcast together with shapes (28,) (0,)

This error is raised when fs_bytes (or cl_bytes) is a numpy ndarray that is compared to the empty list.
A possible solution may be, to cast the arrays to lists and then compare them:

if list(fs_bytes) == [] and list(cl_bytes) == []:

(WFDB Version: 4.1.2, Python 3.11)

@toiflm
Copy link
Author

toiflm commented Nov 29, 2023

another suggestion:
if len(fs_bytes) == 0 and len(cl_bytes) == 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant