Open bhavik3jain opened 8 years ago
Sure. There are probably other ways, but a player's .home
attribute will tell you if he was on the home team.
import nflgame
games = nflgame.games(year=2016, week=5, kind='REG')
for game in games:
for player in game.players:
print '{} ({}) played against {}'.format(player, player.team, game.away if player.home else game.home)
B.Gabbert (SF) played against ARI
...
J.Witten (DAL) played against CIN
...
J.Winston (TB) played against CAR
I am new to this API and I was just wondering if there was a way to get the game information of a specific player. I know I can get all the statistics for the player but can I get the team this player played against?