-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextraanalysis.py
78 lines (60 loc) · 3.67 KB
/
extraanalysis.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
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
# -*- coding: utf-8 -*-
import csv
with open('datasetatoms.csv') as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
line_count = 0
total_time_with_atoms = 0
entries_count_with_atoms = 0
total_time_without_atoms = 0
entries_count_without_atoms = 0
number_finished_with_atom_faster = 0
number_finished_with_atom_less_tries = 0
data = []
for row in csv_reader:
data.append(row)
for row in data:
if line_count == 0:
line_count += 1
else:
minutes = row[9]
technique = row[6]
if technique == 'With Atom':
total_time_with_atoms += float(minutes)
entries_count_with_atoms += 1
else:
total_time_without_atoms += float(minutes)
entries_count_without_atoms += 1
total_time_medium_with_atoms = total_time_with_atoms / entries_count_with_atoms
total_time_medium_without_atoms = total_time_without_atoms / entries_count_without_atoms
print("Total time medium with atoms = %d minutes" % (total_time_medium_with_atoms))
print("Total time medium without atoms = %d minutes" % (total_time_medium_without_atoms))
relative_difference_between_total_time = total_time_medium_with_atoms = 100
decrease = total_time_medium_with_atoms - total_time_medium_without_atoms
decrease = (decrease / total_time_medium_with_atoms) * 100
print("Diferença percentual %f" % decrease)
grouped_by_participant = {}
for row in data[1:]:
dict_key = "%d%d" % (int(row[1]), int(row[2]),)
if dict_key not in grouped_by_participant:
grouped_by_participant[dict_key] = {}
grouped_by_participant[dict_key][row[6]] = {'time': float(row[9]), 'trials': float(row[8])}
number_finished_with_atom_faster_time_difference = 0
number_finished_with_atom_less_tries_difference = 0
for key, participant in grouped_by_participant.items():
if participant['Without Atom']['time'] > participant['With Atom']['time']:
number_finished_with_atom_faster += 1
print("%f %f" % (participant['Without Atom']['time'], participant['With Atom']['time']))
print("%f" % (participant['Without Atom']['time'] - participant['With Atom']['time']))
number_finished_with_atom_faster_time_difference += (participant['Without Atom']['time'] - participant['With Atom']['time'])
if participant['Without Atom']['trials'] > participant['With Atom']['trials']:
number_finished_with_atom_less_tries += 1
print("%f %f" % (participant['Without Atom']['trials'], participant['With Atom']['trials']))
print("%f" % (participant['Without Atom']['trials'] - participant['With Atom']['trials']))
number_finished_with_atom_less_tries_difference += (participant['Without Atom']['trials'] - participant['With Atom']['trials'])
print("Number of users which finished with atoms faster than without atoms = %f" % (number_finished_with_atom_faster))
print("Number of users which finished with atoms faster than without atoms medium = %f" % (number_finished_with_atom_faster_time_difference / number_finished_with_atom_faster))
print("Number of users which finished with atoms less tries than without atoms = %f" % (number_finished_with_atom_less_tries))
print("Number of users which finished with atoms less tries than without atoms medium = %f" % (number_finished_with_atom_less_tries_difference / number_finished_with_atom_less_tries))
print(number_finished_with_atom_faster_time_difference)
print(number_finished_with_atom_less_tries_difference)
# print(f"Total time with atoms {total_time_with_atoms} minutes")