a pythonic query language
Sign in or create a new account.
('/home/jameyer/PyDB/Apps/Fantasy/Source/pyql_dt.py', 111, 'query', 'return PyQL.pyql_dt.DT.query(self,**kwargs)')
('/usr/local/lib/python2.7/dist-packages/PyQL/pyql_dt.py', 206, 'query', 'html = PyQL.plotly_tools.Plotter(res,**kwargs).plot()')
Both fields and conditions are made up of terms.
A term is a valid Python expression in a name space made up of: database parameters; any imported python modules; PyQL Aggregators such as Average (A), Sum (S), and Replace (R); and other domain specific terms.
|About the FantasyData Database||Sample Queries|
The Raw Data
This database is built from the FantasyData csv file called PlayerGame.2015.csv. The player images were downloaded from FantasyData using the urls given in the file called Player.2015.csv. These are available to use in scatter plots by specifing PlayerID as the third request parameter.
Like this for superbowl 50 rushers: RushingAttempts,RushingYards,PlayerID@SeasonType =3 and Week=4.
Join in Player Information with P.
One of the joys of domain specific query languages is that you can join in data as you like. And here I like P.Weight All of the headers of the FantasyData file called Player.2015.csv are available with this P. format. Here are a few important join fields
Team, Number, FantasyPosition, HeightFeet, HeightInches, Weight, BirthDate, College, Experience, DepthOrder, CollegeDraftYear, CollegeDraftRound, CollegeDraftPick, IsUndraftedFreeAgentitionRank
For example to see Height v Weight broken down by FantasyPosition use the PyQL:
Agile Access to Database Parameters
The CamelCaseFormatting of the database parameters is logical, readable, and verbose. With domain specific query languages you make the rules for parameter reference. And here I like:
Access parameters by their capitalized letters and fill in lower case letters to remove any ambiguity.
For example, to see a scatter plot of RushingYardsPerAttempt vs RushingAttempts (using player images as icons),
use the PyQL:
A simple plot to start with compares fantasy point parameters: |
To see a plotly box plot of fantasy points for the top 30 QBs use the PyQL:
To see the week, fantasy salary, and fantasy point for Matt Ryan during the regular season use the PyQL:
To see how fantasy points tracks with fantasy salary use the PyQL:
To see how fantasy points tracks with fantasy salary for Running Backs on each team, use the PyQL:
For a scatter plot of total punt yards v number of punts inside the 20 use the PyQL:
For a scatter plot of total passing yards v total rushing yards for playoff teams use the PyQL
To see Denver's passing yards for each week and passer use the PyQL
I find this very simple one very interesting: