-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstats_test.py
30 lines (23 loc) · 855 Bytes
/
stats_test.py
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
import csv
import numpy as np
resdump = open('stats_test.csv', 'w')
resdump.write('JADE Profits,PRDE Profits\n')
trials = 28
for trial in range(1, trials):
base_y = []
new_y = []
with open('jade_k%02d_F%2.2f_d07_%02d_strats.csv' % (4, 0.8, trial), 'r') as file:
reader = csv.reader(file)
for row in reader:
base_pps = 0
new_pps = 0
for k, elem in enumerate(row):
if 'PRJADE' in elem:
new_pps += float(row[k+4])
elif 'PRDE' in elem:
base_pps += float(row[k+4])
base_y = np.append(base_y, float(base_pps))
new_y = np.append(new_y, float(new_pps))
resdump.write('%3.3f,' % (np.sum(new_y) / 12))
resdump.write('%3.3f\n' % (np.sum(base_y) / 12))
resdump.close()