jjhesk / nbaml

nbaai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Merge-Data

Gathers the top 7 players, then writes the players season averages in team data.

The pkl object games are translated to entries in the team data by correlating the date and the teams full name.

The data is looped over like this:

seasons => games => teams => rosters => season averages => best players

Some things to note: There is a bunch of team entries with no data. This is because the team didnt play on the specified date. Also the season averages are from the end of the season, not from the game date. Also this docent account for the players that actually played in the game. If a player is injured, or tbh probably if they traded mid season. The rosters are determined by all the players seen on a team that season.

and it takes a while to run.... Also for some reason it seems to be corrupting some of the xlsx files. It seems to work fine the first time with a fresh copy of team data. But after its run and the team data is updated, it will error if tried to be run again. havent fixed this yet, probably other bugs too i dont know about yet. just testing and messing around. This seems okay now i think it had to do with me opening the files in excel while trying to open them with pandas at same time.

python3 test.py 

The next step should probably be to create a better data structure, where we have 30 teams per season, each with the 7 best players averages. instead of looking up and recalculating for each game. The data wont change anyways becuase the season averages are all from the end of the season.

About

nbaai


Languages

Language:Python 86.4%Language:HTML 6.9%Language:Shell 3.8%Language:Jupyter Notebook 2.9%