Intermediate Python with Fantasy Football: a Project-Based Guide
while improving your fantasy team with this series of
from the author of
. Together, we'll walk through building three projects that you can use to
analyze your own team and leagues this season
Impatient? Don't want to build all of the tools before using them? No problem! The guide includes
final, working versions of each project you can use immediately
with minimal tweaking
Get Better at Python while Analyzing Your Fantasy Team Using State of the Art Tools
All projects use Fantasy Math model (2020 access included), which was completely rebuilt this offseason to be more accurate than ever.
Includes Web Access!
A 2020 subscription to the web app vesion of Fantasy Math —
a $79 value
(what I sell it for preseason) — is included too!
You'll be learning and working with the same simulations and model that power the backend of FM, but this way you can start taking advantage of the advice immediately.
You know the fundamentals: let's do some real work
While the reactions to Learn to Code with Fantasy Football have been
and many people have built
after reading it, going from fundamentals to building real projects can be a bit of a jump.
Where should I start? How do I structure my code? This program looks complicated — how am I supposed to keep track of everything, let alone build it?
These are common questions when just starting out. Usually they get answered through experience. Working through these projects will help jumpstart that experience.
What We'll Build
All projects involve plenty of Pandas and data visualization practice. Some screenshots:
What You Get
The final, polished
source code for each projects
— which you can adapt to your own team and league or extend to build your own tools.
A an overview of the high level
to make building these types projects easier.
Fantasy Math API Access for 2020
Historical Fantasy Math API Access
— all data from
. For prototyping, practice, back testing, checking decision making, evaluating league members and more.
Fantasy Math Web App
access — includes immediate, FREE, 2020 access to the point and click version of FM too —
a $79 value
Who Do I Start Calculator
We'll build a tool that takes in you and your opponents lineup, a list of guys you're thinking about starting and returns the probability of winning with each one.
Access to the 2020 API means you'll be able to use it to help your team this year.
And the same, best-in-class simulations Fantasy Math uses means you'll be able to take into account variance and real life correlations among players to start the guy who maximizes your probability of winning.
We'll build a league analysis tool to get get projections, betting lines, over-under and probability each team gets the high or low.
Whether you share the results with your league or keep the intel to yourself is up to you.
Best Ball Projector
Enter in different best ball lineups and get back projected scores, utilization percentages and more.
Traditionally, projecting best ball lineups has been difficult/impossible to do with any real accuracy, but working with simulated point projections makes it easy. Plus we'll learn a lot in in the process.
What People Are Saying
About Learn to Code with Fantasy Football
"The book here was
really, really well done
Bill Connelly, ESPN
"This is amazingly awesome. ...
the way the learning is framed here is 10x what you’ll get someplace else.
amazed by how you broke down complicated concepts and made them easier to understand
"Incredible work! ...
already better than expected. Worth every penny.
best / most complete Pandas walk through I've seen
picked up more, and at a better pace
, using this than a lot of the free online tools I’d been trying the past few months. "
"Love the book, bought it a before last season of the nfl.
My python has come a very long way thanks to you.
"...it helped me tremendously ...
I wouldn't be where I'm at with the Python language today without this book to kick start things.
really helpful and a fun way to learn
"I can't tell you how many times I've tried to get into programming and gave up because it was so dry. This has been
such a nice change of pace and I'm loving it
"Just picked up LTCWFF last week and I am really enjoying it so far. This is
exactly what I needed to finally get past tutorial hell and apply Python to something I love
"... I like that your book cuts out the riff raff and teaches the important things!
I'm flying through the book and feel like I'm learning a ton!
Best wishes from a satisfied customer"
"I recently purchased LTCWFF and
could not be more satisfied with the content
. ...it has been great to work through your in-depth examples learning new skills. I had a previous interest in this sort of analysis and have had intermediate programming experience, but never could tie the two together."
Fantasy Math Model:
Advanced Weekly Projections
includes access to the same model that powers Fantasy Math
It's the only one out there to take into account
(player's tendency to boom or bust) and
(the tendency for players in the same game to move in predictable directions.
Much more on the model
. The bottom line is not only will you learn intermediate Python, you'll learn it by putting one of the most advanced Fantasy analysis tools to work for you team.
The Fantasy Math model was
this offseason using PyMC3, a Bayesian and probabilistic machine learning Python package.
The model is more accurate than its ever been
. Below, blue is actual performance (1-5 ranked RBs, standard scoring, 2017-2019), gray are modeled simulations.
Don't worry if you aren't sure how to interpret this graph (
for brief overview, otherwise we cover it in the kit too). Just know
blue in the middle of gray is good
Here are the QBs. Sorry, the blue line is hard to see...
since it's right in the middle of the model!!
1. Take your Python and Pandas beyond the basics.
Learn how to build working, well designed programs that do real work and the concepts and principles that'll help you write these a systematic way.
See both the end product and walk through, learning how you start with something simple/working and extend it.
2. Do Better in Fantasy this Season
Learn to Code with Fantasy Football
was designed as a fun way to learn coding basics using an interesting topic to keep up motivation. This kit is designed to help you in fantasy THIS season.
A lot of other fantasy analytics is interesting, but has minimal practical value to helping you win, especially if you subscribe to the idea fantasy markets are efficient (in which case you're usually best off drafting and setting your lineup according to fantasy consensus).
We'll be working with Fantasy Math's state of the art simulations, which will allow you to go beyond consensus rankings (which are still great, FYI — this work builds off of them) and factor in information you can't get any other way.
3. Pandas Practice
Working with DataFrames of simulations are a great way to practice our data manipulation skills and hammer home key Python and Pandas concepts, including:
summary and plotting functions
You'll know these inside and out by the end of the season.
The data we're working with in the API is flexible and extendible, and after working through and learning how to build real projects, you'll should be in great position to build something you want.
(covered in LTCWFF) to scrape your historical league data, then combine that with the API to figure out who exactly are the worst, best, luckiest, unluckiest owners in your league
use the simulations to build a DFS lineup optimizer and portfolio constructor (
use the correlated simulations to figure out the joint probability of multiple matchups and offer your league-mates odds on parleys (OK, kind of silly, but I guarantee it'd improve your Pandas)
Frequently Asked Questions
Do I need to have finished Learn to Code with Fantasy Football to use this?
No, but if you're a beginner you should at least have gone through Python and Pandas sections.
Many readers have said the appreciated how well this portion of the book in particular gets to the point and gets you doing real stuff (
"exactly what I needed to get past tutorial hell..."
) so it shouldn't take too long.
Reading later chapter on distributions and visualization wouldn't hurt either.
This developer kit also includes final, finished templates that should requires only minimal Python knowledge (as opposed to working through the walk throughs) to adopt to your team and league.
What if I don't know how to code? Can I still use Fantasy Math?
to learn how to code check out my book,
Learn to Code With Fantasy Football
. It doesn't assume any prior knowledge. Working through the first half of the book would put you far enough along to use this kit.
Otherwise there's a web app based, graphical, click around format that gives you the most of benefits (who to start, projections, probability you win) with no coding.
Note this kit includes access to that web based interface too.