MIT-LCP / wfdb-python

Native Python WFDB package
MIT License
737 stars 300 forks source link

ValueError: cannot convert float NaN to integer #44

Closed junyitian closed 7 years ago

junyitian commented 7 years ago

Hello , when I read ecg data from physiobank chfdb. I use wfdb.srdsamp func read. "File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wfdb/records.py", line 948, in srdsamp record = rdsamp(recordname, sampfrom, sampto, channels, True, pbdir, True) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wfdb/records.py", line 764, in rdsamp record.p_signals = record.dac() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wfdb/_signals.py", line 178, in dac p_signal[nanlocs] = np.nan ValueError: cannot convert float NaN to integer " Where do I use the error?

cx1111 commented 7 years ago

Thanks for spotting this. Should be fixed now. My default adcgain was 200 rather than 200. which made the physical signal have dtype = int64 even after gain division.