-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlotOverlap.py
More file actions
32 lines (26 loc) · 802 Bytes
/
PlotOverlap.py
File metadata and controls
32 lines (26 loc) · 802 Bytes
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
from StatTests import *
def select_n(dict, n: int):
ls = list(dict.items())[:n]
selected = []
for thing in ls:
selected.append(thing[0])
return selected
if __name__ == '__main__':
x = [i*10 for i in range(1, 101)]
y = []
t, w = stat_tests(make_table('SeqData.txt'))
t = filter(t)
seq = dict(sorted(t.items(), key=lambda item: item[1]))
t, w = stat_tests(make_table('ArrayData.txt'))
t = filter(t)
array = dict(sorted(t.items(), key=lambda item: item[1]))
for i in x:
count = 0
seq_n = select_n(seq, i)
array_n = select_n(array, i)
for thing in seq_n:
if thing in array_n:
count += 1
y.append(count)
plt.scatter(x, y)
plt.show()