mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-11-10 06:54:44 +00:00
too much iteration
This commit is contained in:
parent
2ff6863c9d
commit
c333ba58df
BIN
data analysis/__pycache__/test.cpython-37.pyc
Normal file
BIN
data analysis/__pycache__/test.cpython-37.pyc
Normal file
Binary file not shown.
42
data analysis/test.py
Normal file
42
data analysis/test.py
Normal file
@ -0,0 +1,42 @@
|
||||
import firebase_admin
|
||||
from firebase_admin import credentials
|
||||
from firebase_admin import firestore
|
||||
import csv
|
||||
import numpy as np
|
||||
|
||||
# Use a service account
|
||||
cred = credentials.Certificate('keys/keytemp.json')
|
||||
#add your own key as this is public. email me for details
|
||||
firebase_admin.initialize_app(cred)
|
||||
|
||||
db = firestore.client()
|
||||
|
||||
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)
|
||||
|
||||
print(full)
|
||||
|
||||
quant_keys = []
|
||||
|
||||
list_teams = ["2022", "16", "2451"]
|
||||
|
||||
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:
|
||||
|
||||
|
||||
print(quant_keys)
|
Loading…
Reference in New Issue
Block a user