-
Notifications
You must be signed in to change notification settings - Fork 0
/
read_csv.py
61 lines (52 loc) · 1.6 KB
/
read_csv.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
import csv
teams = ["MIN","DET","GNB","CHI","DAL","PHI","WAS","NYG","ATL","NOR","TAM","CAR","LAR","ARI","SFO","SEA",
"BAL","PIT","CIN","CLE","MIA","NWE","NYJ","BUF","IND","HOU","TEN","JAX","KAN","DEN","LVR","LAC"] #Array of all the team abbreviations
#Appending stats to arrays based on position from a CSV file
filenameQB = "QB.csv"
fieldsQB = []
rowsQB = []
with open(filenameQB, 'r') as csvfile:
csvreader = csv.reader(csvfile)
fieldsQB = next(csvreader)
for row in csvreader:
rowsQB.append(row)
filenameRB = "RB.csv"
fieldsRB = []
rowsRB = []
with open(filenameRB, 'r') as csvfile:
csvreader = csv.reader(csvfile)
fieldsRB = next(csvreader)
for row in csvreader:
rowsRB.append(row)
filenameOff = "offense.csv"
fieldsOff = []
rowsOff = []
with open(filenameOff, 'r') as csvfile:
csvreader = csv.reader(csvfile)
fieldsOff = next(csvreader)
for row in csvreader:
rowsOff.append(row)
filenamePDef = "passdefense.csv"
fieldsPDef = []
rowsPDef = []
with open(filenamePDef, 'r') as csvfile:
csvreader = csv.reader(csvfile)
fieldsPDef = next(csvreader)
for row in csvreader:
rowsPDef.append(row)
filenameRDef = "rushdefense.csv"
fieldsRDef = []
rowsRDef = []
with open(filenameRDef, 'r') as csvfile:
csvreader = csv.reader(csvfile)
fieldsRDef = next(csvreader)
for row in csvreader:
rowsRDef.append(row)
filenameGames = "games.csv"
fieldsGames = []
rowsGames = []
with open(filenameGames, 'r') as csvfile:
csvreader = csv.reader(csvfile)
fieldsGames = next(csvreader)
for row in csvreader:
rowsGames.append(row)