Skip to content

Instantly share code, notes, and snippets.

@BlueSCar
Created September 4, 2020 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BlueSCar/9ee7e8ae2729cec9a51151b9e459a361 to your computer and use it in GitHub Desktop.
Save BlueSCar/9ee7e8ae2729cec9a51151b9e459a361 to your computer and use it in GitHub Desktop.
import cfbd
import pandas as pd
games = cfbd.GamesApi().get_team_game_stats(year=2020, week=1)
stats = []
for g in games:
for t in g.teams:
for s in t.stats:
stats.append(dict(game_id=g.id, team=t.school, conference=t.conference, category=s.category, stat=s.stat))
df = pd.DataFrame().from_records([s for s in stats])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment