Skip to content

Commit a0d7a5b

Browse files
committed
update script to export data
1 parent 10ce963 commit a0d7a5b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

experiments/management/commands/export_data_files.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def handle(self, *args, **kwargs):
2828

2929
total_points += len(points)
3030

31-
to_float = lambda x: float(x.replace(',', '.'))
31+
# to_float = lambda x: float(x.replace(',', '.'))
3232

3333
participant_id = execution.participant_id
3434
task_description = execution.task.description
@@ -38,9 +38,8 @@ def handle(self, *args, **kwargs):
3838
os.mkdir(file_path)
3939

4040
with open(os.path.join(file_path, "%s.csv" % task_description), 'w') as data_file:
41-
data_file.write('x,y,datetime\n')
41+
data_file.write('x,y,time\n')
4242
for point in points:
43-
datetime = time.mktime(point.datetime.timetuple())
44-
data_file.write("%.2f,%.2f,%f\n" % (to_float(point.x), to_float(point.y), datetime,))
45-
46-
43+
# timestamp = time.mktime(point.datetime.timetuple())
44+
time = point.datetime.strftime('%H:%M:%S:%f')[:-3]
45+
data_file.write("%s,%s,%s\n" % (point.x.replace(',', '.'), point.y.replace(',', '.'), time,))

0 commit comments

Comments
 (0)