Skip to content
Snippets Groups Projects
Commit ada8ffeb authored by René Schöne's avatar René Schöne
Browse files

pdf-png picture seperation

- seperate directories for pdfs and pngs
- notebook update: explicit boxplot colors
- little task for summing up and compute average of column in csv files
parent ff4abed4
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,8 @@ profiling/*
!profiling/*-header
!profiling/kinds.json
*.log
*.png
pngs/*.png
pdfs/*.pdf
.ipynb_checkpoints/
/.tmp
/m_*.tar
......
This diff is collapsed.
......@@ -578,7 +578,7 @@ def avg(column, *files):
with open(f) as fd:
r = csv.reader(fd)
values = [float(row[int(column)]) for row in r if not row[0].isalpha()]
return sum(values) / float(len(values))
return sum(values) * 1.0 / len(values)
print { f : get_average_value(f) for f in files }
@task(name = 'agt')
......@@ -617,6 +617,27 @@ def att_graph_totals():
for step in sorted(steps):
csv.writer(fd).writerow([step]+list(steps[step]))
@task
def sums(f, namecol = 1, stepcol = 2, valuecol = 3, start = '00'):
""" Sums up one column blockwise, where start is the prefix of the name column and marks the begin of a block """
total, length, last_name = 0.0, 0, '?'
total_total, total_length = 0.0, 0
with open(f) as fd:
r = csv.reader(fd)
next(r)
for row in r:
if row[stepcol].startswith(start):
last_name = row[namecol]
if length > 0:
print('{0:15}: {1:3}, Sum: {2:8.3f}, Average: {3:.3f}'.format(last_name, length, total, total*1.0/length))
total_total += total
total_length += length
total, length = 0.0, 0
else:
total += float(row[valuecol])
length += 1
print('Total elements: {0:3}, total sum: {1:3.3f}, total average: {2:.3f}'.format(total_length, total_total, total_total*1.0/total_length))
if __name__ == '__main__':
check()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment