-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Targets and Receptions are the same for players. #217
Comments
You're filtering on only plays where a reception was recorded.
…On Dec 10, 2016 2:15 PM, "theSanchize3" ***@***.***> wrote:
I am looking at the targets and receptions for an upcoming game this
weekend, but I am getting the same number for both stats.
Here is the code:
for t in ['PHI','WAS']:
q = nfldb.Query(db)
q.game(season_year=2016,season_type='Regular',team=t)
q.play_player(receiving_rec__ge=1,team=t)
for p in q.sort('receiving_yds').as_aggregate():
print p.receiving_rec,p.receiving_tar,p.player
And here is the output:
57 57 Jordan Matthews (PHI, WR)
47 47 Zach Ertz (PHI, TE)
45 45 Darren Sproles (PHI, RB)
33 33 Dorial Green-Beckham (PHI, WR)
31 31 Nelson Agholor (PHI, WR)
22 22 Trey Burton (PHI, TE)
7 7 Brent Celek (PHI, TE)
11 11 Ryan Mathews (PHI, RB)
6 6 Paul Turner (PHI, WR)
3 3 Bryce Treggs (PHI, WR)
13 13 Josh Huff (TB, WR)
6 6 Wendell Smallwood (PHI, RB)
3 3 Kenjon Barner (PHI, RB)
1 1 Carson Wentz (PHI, QB)
58 58 Jamison Crowder (WAS, WR)
59 59 Pierre Garcon (WAS, WR)
39 39 DeSean Jackson (WAS, WR)
59 59 Jordan Reed (WAS, TE)
36 36 Vernon Davis (WAS, TE)
37 37 Chris Thompson (WAS, RB)
8 8 Matt Jones (WAS, RB)
2 2 Josh Doctson (WAS, WR)
6 6 Ryan Grant (WAS, WR)
7 7 Maurice Harris (WAS, WR)
1 1 Quinton Dunbar (WAS, CB)
2 2 Niles Paul (WAS, TE)
2 2 Derek Carrier (WAS, TE)
1 1 Rashad Ross (WAS, WR)
4 4 Rob Kelley (WAS, RB)
Is there an issue with my code or is the an issue with the database?
Thanks,
Sanchez
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#217>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC237Rym0LPVN2p_Y2AyfzEQMAxdvUtuks5rGwh-gaJpZM4LJv3E>
.
|
Oh, I didn't realize that. How would I get the number of targets and receptions of all the players with at least one catch on the season? |
With the line import nfldb
db = nfldb.connect()
q = nfldb.Query(db)
q.game(season_year=2016, season_type='Regular')
# q.play_player(receiving_rec__ge=1) # You are doing something like this and it is your problem
q.play_player(receiving_tar__ge=1)
for p in q.sort('receiving_tar').as_aggregate():
if p.receiving_rec:
print p.receiving_rec, p.receiving_tar, p.player
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am looking at the targets and receptions for an upcoming game this weekend, but I am getting the same number for both stats.
Here is the code:
And here is the output:
Is there an issue with my code or is the an issue with the database?
Thanks,
Sanchez
The text was updated successfully, but these errors were encountered: