upload exercises
This commit is contained in:
parent
32ad3f2662
commit
d17339a560
75 changed files with 773 additions and 0 deletions
23
exercises/exerciseA/plot.py
Executable file
23
exercises/exerciseA/plot.py
Executable file
|
@ -0,0 +1,23 @@
|
|||
import os
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
# IO: This loads the timings for you
|
||||
threads, timings = [], []
|
||||
for file in os.listdir('timings'):
|
||||
with open(f'timings/{file}', 'r') as f:
|
||||
n, t = f.read().strip().split(',')
|
||||
threads.append(int(n))
|
||||
timings.append(float(t))
|
||||
threads = np.array(threads)
|
||||
timings = np.array(timings)
|
||||
|
||||
print('This is the data I loaded: threads =', threads, ', timings =',timings)
|
||||
|
||||
fig, axs = plt.subplots()
|
||||
|
||||
# CREATE YOUR PLOT HERE
|
||||
# Remember to label your axis
|
||||
# Feel free to make it pretty
|
||||
|
||||
plt.savefig('threads_v_timings.png', dpi=300)
|
Loading…
Add table
Add a link
Reference in a new issue