-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcpu_clocks_cores.py
114 lines (76 loc) · 3.19 KB
/
cpu_clocks_cores.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/usr/bin/env python
#-*- coding:UTF-8 -*-
#rikujjs
#some aftermath operations that had to be done to the data to make it more analysable. separating clocks and cores etc.
#more data editing scripts to come.
column_headers = ["ID", "Title", "EUrelease", "USrelease", "AUrelease", "Genre", "Theme", #6 täs rivillä
"INTELCPU1CLK","INTELCPU1CORES","INTELCPU1", "AMDCPU1CLK","AMDCPU1CORE","AMDCPU1", "NVIDIAGPU1","NVIDIAGPU1MEMORY", "AMDGPU1","AMDGPU1MEMORY", "RAM1", "OS1", "DX1", "HDD1",
"INTELCPU2CLK","INTELCPU2CORES","INTELCPU2", "AMDCPU2CLK","AMDCPU2CORE","AMDCPU2", "NVIDIAGPU2","NVIDIAGPU2MEMORY", "AMDGPU2","AMDGPU2MEMORY", "RAM2", "OS2", "DX2", "HDD2",
"INTELCPU3CLK","INTELCPU3CORES","INTELCPU3", "AMDCPU3CLK","AMDCPU3CORE","AMDCPU3", "NVIDIAGPU3","NVIDIAGPU3MEMORY", "AMDGPU3","AMDGPU3MEMORY", "RAM3", "OS3", "DX3", "HDD3"]
def edit(game):
return game
if __name__ == "__main__":
input_f = "game-debate_jee.csv"
source = open(input_f, 'r')
destination = open("game-debate_jee2.csv", 'w')
skip = 0
column = 13 #10 = intel cpu1, #22 = intel cpu2, #34 = intel cpu3
counter = 0
speed = '-'
for line in source:
if skip < 2:
skip += 1
destination.write(line)
continue
game = line.split(';')
#nvidia1 memory
if "MB" in game[column]:
words = game[column].split(" ")
for word in words:
if "MB" in word:
game[column+1] = word.replace("MB", "").strip()
#amd1 memory
if "MB" in game[column+2]:
words = game[column+2].split(" ")
for word in words:
if "MB" in word:
game[column+3] = word.replace("MB", "").strip()
#nvidia2
if "MB" in game[27]:
words = game[27].split(" ")
for word in words:
if "MB" in word:
game[28] = word.replace("MB", "").strip()
#amd2
if "MB" in game[29]:
words = game[29].split(" ")
for word in words:
if "MB" in word:
game[30] = word.replace("MB", "").strip()
#nvidia2
if "MB" in game[41]:
words = game[41].split(" ")
for word in words:
if "MB" in word:
game[42] = word.replace("MB", "").strip()
#amd2
if "MB" in game[43]:
words = game[43].split(" ")
for word in words:
if "MB" in word:
game[44] = word.replace("MB", "").strip()
#------------------- remove possible other platform products
if "Blackberry" in game[1] and "[PC]" not in game[1]:
counter += 1
continue
print line
#-------------------------------no edits after this line, writing back to file-----------------------------------------
out_text = ""
for line in game:
out_text += ';'
out_text += line.strip()
out_text = out_text.replace(";", "", 1)
out_text += '\n'
destination.write(out_text)
speed = '-'
print counter