-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSv.py
More file actions
21 lines (20 loc) · 686 Bytes
/
Copy pathCSv.py
File metadata and controls
21 lines (20 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 30 23:23:48 2018
@author: AARUSHI"""
import csv
file = open('30secepoch4.csv','w')
writer = csv.writer(file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
with open('SC4011EC-Hypnogram_data_annotations.csv') as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
line_count = 0
for row in csv_reader:
print(row)
if(line_count>0):
dur =int(row[1])
print(dur)
while(dur>0):
writer.writerow([row[0],'30',row[2]])
print([row[0],'30',row[2]])
dur = dur-30
line_count+=1