Fixed ou values

This commit is contained in:
BooshPC 2025-01-31 13:55:31 -05:00
parent df1c290dc6
commit de8485cf37
2 changed files with 152249 additions and 171 deletions

@ -15,7 +15,7 @@ fullObj = []
start_year = 1952 start_year = 1952
for year in tqdm(range(start_year, 1954)): for year in tqdm(range(start_year, 2025)):
with open("src/data/"+str(year)+".html") as fp: with open("src/data/"+str(year)+".html") as fp:
soup = BeautifulSoup(fp, 'html.parser') soup = BeautifulSoup(fp, 'html.parser')
@ -50,20 +50,20 @@ for year in tqdm(range(start_year, 1954)):
else: else:
spreadVal = -1 spreadVal = -1
ouValSearch = re.search(r'.\s-?(\d+)', cells[cursor+8].string) if cells[cursor+9].length is None:
if ouValSearch: ouVal = None
ouVal = ouValSearch.group(1)
else: else:
ouVal = -1 ouVal = cells[cursor+9].string
game["spread"] = spreadVal game["spread"] = spreadVal
game["ou"] = ouVal game["ou"] = ouVal
if spreadVal != -1 and ouVal != -1: if spreadVal != -1 and ouVal:
game["pScore"] = calcPredictedScore(game["sF"],game["sU"],spreadVal,ouVal) game["pScore"] = calcPredictedScore(game["sF"],game["sU"],spreadVal,ouVal)
fullObj.append(game) fullObj.append(game)
except: except Exception as e:
print(e)
print("Error parsing " + str(year)) print("Error parsing " + str(year))
objson = json.dumps(fullObj, indent=4) objson = json.dumps(fullObj, indent=4)

File diff suppressed because it is too large Load Diff