Aura-healthcare / hrv-analysis

Package for Heart Rate Variability analysis in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'>=' not supported between instances of 'int' and 'ellipsis'

martinfrasch opened this issue · comments

running the line below with the demo code produces the above-stated error in preprocessing.py

This remove outliers from signal

rr_intervals_without_outliers = remove_outliers(rr_intervals=rr_intervals_list,
low_rri=300, high_rri=2000)

I use python 3.6. Is that a Python version conflict issue? There are other errors thrown in the subsequent methods function_base.py and fromnumeric.py all related to TypeError: unsupported operand type(s) for -: 'ellipsis' and 'int'.

Full error message:


TypeError Traceback (most recent call last)
in ()
1 # This remove outliers from signal
2 rr_intervals_without_outliers = remove_outliers(rr_intervals=rr_intervals_list,
----> 3 low_rri=300, high_rri=2000)
4 # This replace outliers nan values with linear interpolation
5 interpolated_rr_intervals = interpolate_nan_values(rr_intervals=rr_intervals_without_outliers,

~/anaconda3/lib/python3.6/site-packages/hrvanalysis/preprocessing.py in remove_outliers(rr_intervals, verbose, low_rri, high_rri)
58 # Conversion RrInterval to Heart rate ==> rri (ms) = 1000 / (bpm / 60)
59 # rri 2000 => bpm 30 / rri 300 => bpm 200
---> 60 rr_intervals_cleaned = [rri if high_rri >= rri >= low_rri else np.nan for rri in rr_intervals]
61
62 if verbose:

~/anaconda3/lib/python3.6/site-packages/hrvanalysis/preprocessing.py in (.0)
58 # Conversion RrInterval to Heart rate ==> rri (ms) = 1000 / (bpm / 60)
59 # rri 2000 => bpm 30 / rri 300 => bpm 200
---> 60 rr_intervals_cleaned = [rri if high_rri >= rri >= low_rri else np.nan for rri in rr_intervals]
61
62 if verbose:

TypeError: '>=' not supported between instances of 'int' and 'ellipsis'

Hi Martin,

I'm having a hard time understanding what happened but I don't think it is a Python version issue.
It might be due to an "int" conversion being required as says this stackoverflow topic.

Could you give me the code sample + the data you used ? I'll try to debug this on my laptop.

Thanks for reporting this issue !
Regards,
Robin

Hi Robin!
Thanks so much for your response.
You were 100% correct. The error was in my handling the data. I fixed it now.
Thank you!
Best regards,
Martin