GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Graphics/processCSV.py at master · naftalima/Graphics

Expand file tree

/

processCSV.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
71 lines (55 loc) · 1.98 KB
/

processCSV.py

Copy path

File metadata and controls

71 lines (55 loc) · 1.98 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import csv
"""
#type(reader) == _csv.reader
for row in reader:
# type(row) == list # linha
for column in row:
# type(column) == str # coluna
"""
with open('arquivo.csv', 'rb') as inp, open('arquivoEdit.csv', 'wb') as out:
writer = csv.writer(out)
contador=0
for row in csv.reader(inp):
if contador >= 3 and contador < 9995 :
# do 4 ate o 10000
writer.writerow(row)
contador+=1
with open('arquivoEdit.csv', 'rb') as csvfile, open('arquivoFinal.csv', 'wb') as final:
reader = csv.reader(csvfile, delimiter=',', quotechar='|')
writere = csv.writer(final)
lista = []
contador = 0
for row in reader:
for column in row:
if "[" in column:
# " [%]"
if " [%]" in column:
column = column.replace(" [%]","")
# (Normalized) [%]
if "(Normalized)" in column:
column = column.replace("(Normalized)","Normalized")
# " [ms]" || Time*
if " [ms]" in column:
column = column.replace(" [ms]","")
column = column + str(contador)
contador+=1
# " [kHz]"
if " [kHz]" in column:
column = column.replace(" [kHz]","")
# " [KB]"
if " [KB]" in column:
column = column.replace(" [KB]","")
# "* [uW]"
if "* [uW]" in column:
column = column.replace("* [uW]","")
column = column.replace(" ","")
lista.append(column)
break # Percorre apenas a primeira linha
writere.writerow(lista)
contador=0
for row in reader:
if contador >=1 :
writere.writerow(row)
contador+=1
print(lista)
#conferir se os respectivos Times estao certos para fazer o chart com o script em R
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.