-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnotes.txt
36 lines (26 loc) · 1.36 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
donehypnogram/shhs1-200230.hypnogram.txt
donehypnogram/shhs1-202180.hypnogram.txt
donehypnogram/shhs1-203065.hypnogram.txt
donehypnogram/shhs1-202310.hypnogram.txt
These files had all 0s (all wake) to begin with so I dropped them.
Removed them from the unzipped data, and dropped them in the code.
This code showed that 204015 was not in the fileids. I am removing this from the original csv.
Also showed that 200230, 202180, 202310, 203065 were not in the ids. I am removing these from the files directory.
201593 becomes a single 3 after zero removal, deleting file and row.
| fileids = [filename.split('.')[0].split('-')[1] for filename in files]
|
| df = pd.read_csv(original_csv)
| ids = [str(i) for i in df["nsrrid"].values]
|
| # show items in ids not in files
| for i in ids:
| if i not in fileids:
| print(i)
# show items in files not in ids
| for i in fileids:
| if i not in ids:
| print("not in ids: " + i)
shhs 999999 is a test file to make sure calculations are correct.
999999,1.038318912,1,1,1,0,1,0,3,4,2,2,50.34061001,59.27355033,53,4,2,25.37448347,2,93,0,0,7.571428571,0,0,26.25,260.25,3.75,90.25,98.75,2,0.9826,10.25,21,0.999,0.00116,0.000197,5.44E-06,5.79E-05,77.73237998
Our timeinbed calculation is not entirely accurate, because we drop zeros from the hypnogram files.
It is a rough estimation of the start of sleep to the end of sleep.