-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateExcelFile.py
More file actions
134 lines (118 loc) · 2.4 KB
/
Copy pathcreateExcelFile.py
File metadata and controls
134 lines (118 loc) · 2.4 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import xlsxwriter
import os
from feedback import *
def createFile(subj, trial_type, session, player_times, std, m, r_std, r_m):
os.chdir('/home/matt/Documents/Drummer Experiment/Data')
workbk = xlsxwriter.Workbook(('%s.xlsx')%subj)
worksheet = workbk.add_worksheet()
worksheet.write(0, 0, "Subject")
worksheet.write(0, 1, 'Trial')
worksheet.write(0, 2, 'Trial Block')
worksheet.write(0, 3, 'Trial by Block')
worksheet.write(0, 4, "Trial Type")
worksheet.write(0, 5, "Session")
worksheet.write(0, 6, "Player Times")
worksheet.write(0, 7, "Frequency of Tapping")
worksheet.write(0, 8, "STDEV")
worksheet.write(0, 9, "MEAN")
worksheet.write(0, 10, "Rounded Frequency of Tapping")
worksheet.write(0, 11, "Rounded STDEV")
worksheet.write(0, 12, "Rounded MEAN")
#Subj name
col = 0
row = 1
while row <501:
worksheet.write(row, col, subj)
row+=1
#Trial Number
row = 1
col +=1
while row < 501:
worksheet.write(row, col, row)
row+=1
#Trial block
row = 1
col +=1
i = 1
while row < 501:
for x in range(25):
worksheet.write(row, col, i)
row+=1
i+=1
#Trialby block
row = 1
col +=1
i = 1
while row < 501:
i = 1
for x in range(25):
worksheet.write(row, col, i)
row+=1
i+=1
#Trial Type
row = 1
col += 1
for item in trial_type:
for i in range(250):
worksheet.write(row, col, item)
row+=1
row = 251
#Session
row = 1
col += 1
for i in range(500):
worksheet.write(row, col, session[0])
row+=1
#Player times
row = 1
col+=1
for i in range(len(player_times)):
worksheet.write(row, col, player_times[i])
row+=1
#freq of tapping
col+=1
row = 2
diff = rate(player_times)
for i in range(len(diff)):
if diff[i] > 5000:
worksheet.write(row, col, "")
row+=1
else:
worksheet.write(row, col, diff[i])
row+=1
#standard deviation
col+=1
row = 1
for item in std:
worksheet.write(row, col, int(item))
row+=25
#Mean
col+=1
row = 1
for item in m:
worksheet.write(row, col, int(item))
row+=25
#Rounded Delta of player times
r_diff = round_rate(player_times)
col+=1
row =2
for i in range(len(r_diff)):
if r_diff[i] > 5000:
worksheet.write(row, col, "")
row+=1
else:
worksheet.write(row, col, r_diff[i])
row+=1
#rounded std
col+=1
row = 1
for item in r_std:
worksheet.write(row, col, int(item))
row+=25
#rounded mean
col+=1
row = 1
for item in r_m:
worksheet.write(row, col, int(item))
row+=25
workbk.close()