Last active
October 20, 2015 18:15
-
-
Save ochawkeye/dd812022777b2734a316 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nfldb | |
NYGmisc = {} | |
db = nfldb.connect() | |
qNYG = nfldb.Query(db) | |
for gp in qNYG.play_player(team='NYG').player(position='TE').as_aggregate(): | |
# NYGmisc[gp.player] = gp <-- if you do like this, the values are class 'nfldb.query.AggPP' | |
NYGmisc[gp.player] = {field: getattr(gp, field) for field in gp.fields} # but if you do like this they are type 'dict' | |
for x in NYGmisc: | |
print type(x), type(NYGmisc[x]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this worked for me:
and in my index.html template:
This displays the data I want.