In [1]:
# -*- coding: utf8
%matplotlib inline
In [2]:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
In [7]:
df = pd.read_csv('8020.dat')
df = df.ix[df['cachesize'].argsort()]
df
Out[7]:
algorithm
faults
cachesize
clockfreq
input
0
random
1960
1
1
8020
127
fifo
1960
1
1
8020
166
fifo
1918
2
1
8020
39
random
1912
2
1
8020
50
random
1845
3
1
8020
177
fifo
1849
3
1
8020
188
fifo
1821
4
1
8020
61
random
1822
4
1
8020
199
fifo
1777
5
1
8020
72
random
1765
5
1
8020
83
random
1722
6
1
8020
210
fifo
1735
6
1
8020
221
fifo
1659
7
1
8020
94
random
1653
7
1
8020
105
random
1595
8
1
8020
232
fifo
1615
8
1
8020
116
random
1573
9
1
8020
243
fifo
1580
9
1
8020
1
random
1554
10
1
8020
128
fifo
1563
10
1
8020
139
fifo
1509
11
1
8020
12
random
1542
11
1
8020
23
random
1436
12
1
8020
150
fifo
1449
12
1
8020
32
random
1476
13
1
8020
159
fifo
1437
13
1
8020
33
random
1365
14
1
8020
160
fifo
1345
14
1
8020
161
fifo
1302
15
1
8020
34
random
1350
15
1
8020
...
...
...
...
...
...
143
fifo
173
113
1
8020
16
random
159
113
1
8020
17
random
151
114
1
8020
144
fifo
165
114
1
8020
145
fifo
160
115
1
8020
18
random
152
115
1
8020
146
fifo
171
116
1
8020
19
random
151
116
1
8020
20
random
134
117
1
8020
147
fifo
146
117
1
8020
148
fifo
161
118
1
8020
21
random
140
118
1
8020
149
fifo
152
119
1
8020
22
random
138
119
1
8020
24
random
126
120
1
8020
151
fifo
139
120
1
8020
25
random
125
121
1
8020
152
fifo
138
121
1
8020
153
fifo
137
122
1
8020
26
random
130
122
1
8020
154
fifo
138
123
1
8020
27
random
134
123
1
8020
28
random
123
124
1
8020
155
fifo
123
124
1
8020
29
random
130
125
1
8020
156
fifo
140
125
1
8020
157
fifo
126
126
1
8020
30
random
126
126
1
8020
31
random
127
127
1
8020
158
fifo
127
127
1
8020
254 rows × 5 columns
In [4]:
df.groupby(['algorithm']).mean()
Out[4]:
faults
cachesize
clockfreq
input
algorithm
fifo
597.283465
64.0
1.0
8020.0
random
589.960630
64.0
1.0
8020.0
In [5]:
fifo_data = df[df['algorithm'] == 'fifo']
random_data = df[df['algorithm'] == 'random']
In [6]:
plt.plot(fifo_data['cachesize'],
fifo_data['faults'], label='FIFO')
plt.plot(random_data['cachesize'],
random_data['faults'], label='Random')
plt.xlabel('Cache Size')
plt.ylabel('Num. Page Faults')
Out[6]:
<matplotlib.text.Text at 0x7fd149aea470>
In [ ]:
Content source: flaviovdf/SO-2017-1
Similar notebooks: