Update superscript.py

This commit is contained in:
ltcptgeneral 2019-03-21 15:07:24 -05:00
parent 82754ede58
commit 4227106b4f

View File

@ -220,86 +220,6 @@ def pulldata():
with open("data/scores.csv", "w+", newline = '') as file: with open("data/scores.csv", "w+", newline = '') as file:
writer = csv.writer(file, delimiter = ',') writer = csv.writer(file, delimiter = ',')
writer.writerows(scores) writer.writerows(scores)
teams = db.collection('data').document('team-2022').collection("Central 2019").get()
full=[]
tms=[]
for team in teams:
data=[]
tms.append(team.id)
reports=db.collection('data').document('team-2022').collection("Central 2019").document(team.id).collection("matches").get()
for report in reports:
data.append(db.collection('data').document('team-2022').collection("Central 2019").document(team.id).collection("matches").document(report.id).get().to_dict())
full.append(data)
quant_keys = []
list_teams = analysis.load_csv('data/teams.csv')
out = []
var = {}
for i in range(len(full)):
for j in range(len(full[i])):
for key in list(full[i][j].keys()):
if "Quantitative" in key:
quant_keys.append(key)
if full[i][j].get(key).get('teamDBRef')[5:] in list_teams:
var = {}
measured_vars = []
for k in range(len(list(full[i][j].get(key).keys()))):
individual_keys = list(full[i][j].get(key).keys())
var[individual_keys[k]] = full[i][j].get(key).get(individual_keys[k])
out.append(var)
sorted_out = []
for i in out:
j_list = []
key_list = []
sorted_keys = sorted(i.keys())
for j in sorted_keys:
key_list.append(i[j])
j_list.append(j)
sorted_out.append(key_list)
var_index = 0
team_index = 0
big_out = []
for i in sorted_out:
team_index = list_teams.index(sorted_out[sorted_out.index(i)][j_list.index('teamDBRef')][5:])
for j in range(len(i)):
print(j)
print(team_index)
print(i[j])
print(i)
print(big_out)
big_out[j][team_index].append(i[j])
print(big_out)
def service(): def service():