wfdb-python icon indicating copy to clipboard operation
wfdb-python copied to clipboard

ZeroDivisionError in evaluate.py

Open pranavchat14 opened this issue 4 years ago • 3 comments

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.

pranavchat14 avatar Feb 22 '21 18:02 pranavchat14

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.

Lucas-Mc avatar Mar 30 '21 18:03 Lucas-Mc

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

pranavchat14 avatar Apr 05 '21 07:04 pranavchat14

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?

Lucas-Mc avatar Apr 07 '21 15:04 Lucas-Mc