You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 14, 2024. It is now read-only.
TypeError: 'float' object does not support item assignment
when I am taking the dataset of ST7022JM-Hypnogram.edf or any other hypnogram.edf from physionet in sleep telemetry while converting into csv file format
How do I resolve it !!
The text was updated successfully, but these errors were encountered:
importcsvfrompyedflibimporthighleveldefconvert_hypnograms(hypnogram_edf_file):
""" This function is quite a hack to read the edf hypnogram as a byte array. I found no working reader for the hypnogram edfs. """hypnogram= []
annot=highlevel.read_edf_header(hypnogram_edf_file)['annotations']
forbstart, blength, bstageinannot:
length=int(blength.decode())
stage=bstage.decode()
if'movement'instage.lower(): stage='M'stage= [str(stage[-1])]*(length//30)
hypnogram.extend(stage)
csv_file=hypnogram_edf_file.replace('-Hypnogram','')[:-5] +'0-PSG.csv'withopen(csv_file, "w") asf:
writer=csv.writer(f, lineterminator='\r')
writer.writerows(hypnogram)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi Simon
I am just getting a error
TypeError: 'float' object does not support item assignment
when I am taking the dataset of ST7022JM-Hypnogram.edf or any other hypnogram.edf from physionet in sleep telemetry while converting into csv file format
How do I resolve it !!
The text was updated successfully, but these errors were encountered: