Skip to content
Snippets Groups Projects
Commit 8e0cc6b0 authored by Laura Rævsbæk Birch's avatar Laura Rævsbæk Birch
Browse files

Upload New File

parent 68fb1ef1
No related branches found
No related tags found
1 merge request!1new laura folder
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
import csv
def create_loaded_channels_tsv(path, channels):
with open(path, 'wt') as out_file:
tsv_writer = csv.writer(out_file, delimiter='\t', lineterminator='\n')
channelRow = []
# Creating headers for channels.tsv
channelRow.append('name')
channelRow.append('type')
channelRow.append('units')
tsv_writer.writerow(channelRow)
channelRow.clear()
# Writing channels to channels.tsv
for row in channels:
if (row == 'trigger'):
break
channelRow.append(row)
if (row.__contains__('EMG')):
channelRow.append('EMG')
elif (row.__contains__('ECG')):
channelRow.append('ECG')
elif (row.__contains__('EOG')):
channelRow.append('EOG')
else:
channelRow.append('EEG')
channelRow.append('uV')
tsv_writer.writerow(channelRow)
channelRow.clear()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment