Skip to content

ZeroDivisionError in evaluate.py #278

Open

Description

@pranavchat14

This is the error I get when trying to run xqrs detection algorithm from Google Colab as well locally.
I have used demo.ipynb from the repo itself.

/usr/local/lib/python3.6/dist-packages/wfdb/processing/evaluate.py in _calc_stats(self)
118 # No tn attribute
119
--> 120 self.sensitivity = float(self.tp) / float(self.tp + self.fn)
121 self.positive_predictivity = float(self.tp) / self.n_test
122

ZeroDivisionError: float division by zero

The error seems very weird in the sense that even when I comment the particular line, the error still shows in the same line.

Activity

  1. Lucas-Mc commented on Mar 30, 2021

    @Lucas-Mc
    Contributor

    Hey @pranavchat14, thanks for the comment! Can you post some more details to recreate this issue? I can't seem to reproduce this error using the current version of demo.ipynb.

  2. pranavchat14 commented on Apr 5, 2021

    @pranavchat14
    Author

    Thanks for the response.
    Here is the link to the cell from my copy of demo.ipynb. Hope this helps in reproduction of error.

    https://colab.research.google.com/drive/1__CGXTI-dd2foGm8UCzlNStnOLptxpTG#scrollTo=1PR6lUw3403k&line=7&uniqifier=1

  3. Lucas-Mc commented on Apr 7, 2021

    @Lucas-Mc
    Contributor

    Thanks for the extra info! The only difference is the file /content/tmp_dl_dir/0001 instead of sample-data/100... what are the contents of that file?

  4. added a commit that references this issue on Apr 8, 2026
    49905a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions